summaryrefslogtreecommitdiff
path: root/cppe
diff options
context:
space:
mode:
Diffstat (limited to 'cppe')
-rw-r--r--cppe/include/IceE/BasicStream.h28
-rw-r--r--cppe/src/IceE/BasicStream.cpp30
2 files changed, 26 insertions, 32 deletions
diff --git a/cppe/include/IceE/BasicStream.h b/cppe/include/IceE/BasicStream.h
index f3a5791d1bd..e6e07a54185 100644
--- a/cppe/include/IceE/BasicStream.h
+++ b/cppe/include/IceE/BasicStream.h
@@ -81,8 +81,32 @@ public:
}
void startSeq(int, int);
- void checkSeq();
- void checkSeq(int);
+ void checkSeq()
+ {
+ checkSeq(static_cast<int>(b.end() - i));
+ }
+ void checkSeq(int bytesLeft)
+ {
+ //
+ // Check, given the number of elements requested for this sequence,
+ // that this sequence, plus the sum of the sizes of the remaining
+ // number of elements of all enclosing sequences, would still fit
+ // within the message.
+ //
+ int size = 0;
+ SeqData* sd = _seqDataStack;
+ do
+ {
+ size += (sd->numElements - 1) * sd->minSize;
+ sd = sd->previous;
+ }
+ while(sd);
+
+ if(size > bytesLeft)
+ {
+ throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
+ }
+ }
void checkFixedSeq(int, int); // For sequences of fixed-size types.
void endElement()
{
diff --git a/cppe/src/IceE/BasicStream.cpp b/cppe/src/IceE/BasicStream.cpp
index 85aaa3fecdc..139e7d2b731 100644
--- a/cppe/src/IceE/BasicStream.cpp
+++ b/cppe/src/IceE/BasicStream.cpp
@@ -177,36 +177,6 @@ IceInternal::BasicStream::startSeq(int numElements, int minSize)
}
}
-//
-// Check, given the number of elements requested for this sequence,
-// that this sequence, plus the sum of the sizes of the remaining
-// number of elements of all enclosing sequences, would still fit
-// within the message.
-//
-void
-IceInternal::BasicStream::checkSeq()
-{
- checkSeq(static_cast<int>(b.end() - i));
-}
-
-void
-IceInternal::BasicStream::checkSeq(int bytesLeft)
-{
- int size = 0;
- SeqData* sd = _seqDataStack;
- do
- {
- size += (sd->numElements - 1) * sd->minSize;
- sd = sd->previous;
- }
- while(sd);
-
- if(size > bytesLeft)
- {
- throw UnmarshalOutOfBoundsException(__FILE__, __LINE__);
- }
-}
-
void
IceInternal::BasicStream::checkFixedSeq(int numElements, int elemSize)
{