Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Commit

Permalink
Additional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wipe2238 committed Apr 30, 2013
1 parent 87fd21a commit 0d73f14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions buffer.fos
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,26 @@ final class CBuffer : Buffer

Buffer@ opShr( string& value ) // Buffer >> value
{
#ifdef BUFFER_UNICODE
value.rawResize(0);
#endif
#ifndef BUFFER_UNICODE
value.resize(0);
#endif
BUFFER_LENTYPE len = 0;
this >> len;
for( uint s=0; s<len; s++ )
{
uint8 char = 0;
this >> char;
#ifdef BUFFER_UNICODE
value.rawResize(s+1);
value.rawSet(s, char);
#endif
#ifndef BUFFER_UNICODE
value.resize(s+1);
value[s] = char;
#endif
}
return( this );
}
Expand Down
4 changes: 4 additions & 0 deletions buffer_h.fos
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
// How length of string/arrays will be stored in buffer
#define BUFFER_LENTYPE uint16

// Backward compatibility
// Undefine if using SDK older than revision 400
#define BUFFER_UNICODE

shared interface Buffer
{
bool IsRaw( uint len );
Expand Down

0 comments on commit 0d73f14

Please sign in to comment.