diff options
author | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-04-28 03:50:28 +0000 |
---|---|---|
committer | john_c <john_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-04-28 03:50:28 +0000 |
commit | 88556d568eb0a06bf8af2ddefacbc1ad5f00401e (patch) | |
tree | 72f4a0e33b9dd26d1783ff005d67494bfb79a9de /ace/CDR_Stream.cpp | |
parent | 317d8c1ce78436f0107f056418c0c5f5b4231069 (diff) | |
download | ATCD-oci_dave_wchar_refactor_branch.tar.gz |
4_27_06 branch merge in and compile error fixedoci_dave_wchar_refactor_branch
Diffstat (limited to 'ace/CDR_Stream.cpp')
-rw-r--r-- | ace/CDR_Stream.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ace/CDR_Stream.cpp b/ace/CDR_Stream.cpp index 2ca41fe93ed..afc43abc05b 100644 --- a/ace/CDR_Stream.cpp +++ b/ace/CDR_Stream.cpp @@ -613,6 +613,30 @@ ACE_OutputCDR::write_array (const void *x, return false; } + +ACE_CDR::Boolean +ACE_OutputCDR::replace (ACE_CDR::Long x, char* loc) +{ + if (this->find (loc) == 0) + return false; + +#if !defined (ACE_ENABLE_SWAP_ON_WRITE) + *reinterpret_cast<ACE_CDR::Long*> (loc) = x; +#else + if (!strm->do_byte_swap ()) + { + *reinterpret_cast<ACE_CDR::Long *> (loc) = x; + } + else + { + ACE_CDR::swap_4 (reinterpret_cast<const char*> (&x), loc); + } +#endif /* ACE_ENABLE_SWAP_ON_WRITE */ + + return true; +} + + ACE_CDR::Boolean ACE_OutputCDR::write_boolean_array (const ACE_CDR::Boolean* x, ACE_CDR::ULong length) @@ -632,6 +656,23 @@ ACE_OutputCDR::write_boolean_array (const ACE_CDR::Boolean* x, return this->good_bit (); } + +ACE_Message_Block* +ACE_OutputCDR::find (char* loc) +{ + ACE_Message_Block* mb = 0; + for (mb = &this->start_; mb != 0; mb = mb->cont ()) + { + if (loc <= mb->wr_ptr () && loc >= mb->rd_ptr ()) + { + break; + } + } + + return mb; +} + + // **************************************************************** ACE_InputCDR::ACE_InputCDR (const char *buf, |