LRAUV  revA
CodedStr.h
Go to the documentation of this file.
1 
9 #ifndef CODEDSTR_H_
10 #define CODEDSTR_H_
11 
12 #include "Str.h"
13 #include "io/InStream.h"
14 #include "io/OutStream.h"
15 
23 class CodedStr : public Str
24 {
25 public:
26  CodedStr( const Str& strIn, unsigned short code = NO_CODE );
27 
28  virtual ~CodedStr()
29  {}
30 
31  unsigned short getCode() const
32  {
33  return code_;
34  }
35 
36  void setCode( const unsigned short code )
37  {
38  code_ = code;
39  }
40 
41  unsigned int write( OutStream& outStream ) const;
42 
43  static CodedStr* Read( InStream& inStream );
44 
45  static const unsigned short NO_CODE = 0x3FFF;
46 
47 private:
48 
49  unsigned short code_;
50 
51 };
52 
53 #endif /*CODEDSTR_H_*/
unsigned int write(OutStream &outStream) const
Definition: CodedStr.cpp:23
unsigned short code_
Definition: CodedStr.h:49
virtual ~CodedStr()
Definition: CodedStr.h:28
static const unsigned short NO_CODE
Definition: CodedStr.h:45
Contains the OutStream class declaration.
void setCode(const unsigned short code)
Definition: CodedStr.h:36
This is a very abstract class that can be implemented by classes that want to receive stream input...
Definition: InStream.h:29
Extends the Str class, adding an unsigned short code (actually, the codes are limited to 14 bits...
Definition: CodedStr.h:23
CodedStr(const Str &strIn, unsigned short code=NO_CODE)
Extends the Str class, adding an unsigned short code (actually, the codes are limited to 14 bits...
Definition: CodedStr.cpp:18
Replacement for standard template class string.
Definition: Str.h:12
Contains the InStream and NullInStream class declarations.
static CodedStr * Read(InStream &inStream)
Definition: CodedStr.cpp:39
This is a very abstract class that can be implemented by classes that want to send stream output...
Definition: OutStream.h:41
unsigned short getCode() const
Definition: CodedStr.h:31