diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2006-02-06 14:21:00 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2006-02-06 14:21:00 +0000 |
commit | 79496603519f5356862f5bd537dd0b161d33d4be (patch) | |
tree | 9d445c1157b839098e3276dcaa10328b00866fc2 /cpp/src/Ice/BasicStream.cpp | |
parent | Fixed one-shot constructors. (diff) | |
download | ice-79496603519f5356862f5bd537dd0b161d33d4be.tar.bz2 ice-79496603519f5356862f5bd537dd0b161d33d4be.tar.xz ice-79496603519f5356862f5bd537dd0b161d33d4be.zip |
Added support for alternate sequences Added custom test
Diffstat (limited to 'cpp/src/Ice/BasicStream.cpp')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index 340c1d97ad0..f5d47b2ca0a 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -787,6 +787,36 @@ IceInternal::BasicStream::read(vector<bool>& v) } void +IceInternal::BasicStream::read(pair<const bool*, const bool*>& v, IceUtil::auto_array<bool>& b) +{ + Int sz; + readSize(sz); + if(sz > 0) + { + checkFixedSeq(sz, 1); +#if defined(__APPLE__) + bool* array = new bool[sz]; + for(int idx; idx < sz; ++idx) + { + array[idx] = (bool)*(i + idx); + } + v.first = array; + v.second = array + sz; + b.reset(array); +#else + assert(sizeof(bool) == 1); + v.first = reinterpret_cast<bool*>(i); + v.second = reinterpret_cast<bool*>(i) + sz; +#endif + i += sz; + } + else + { + v.first = v.second = reinterpret_cast<bool*>(i); + } +} + +void IceInternal::BasicStream::write(Short v) { Container::size_type pos = b.size(); |