Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _str_h
00037 #define _str_h 1
00038
00039 #include <string>
00040
00041 #include "dods-limits.h"
00042 #include "BaseType.h"
00043
00044 #define FILE_METHODS 1
00045
00046 namespace libdap
00047 {
00048
00049
00050
00051
00052
00053
00054
00055
00056 const unsigned int max_str_len = DODS_USHRT_MAX - 1;
00057
00064 class Str: public BaseType
00065 {
00066
00067 protected:
00068 string _buf;
00069
00070 public:
00071 Str(const string &n);
00072 Str(const string &n, const string &d);
00073
00074 virtual ~Str()
00075 {}
00076
00077 Str(const Str ©_from);
00078
00079 Str &operator=(const Str &rhs);
00080
00081 virtual BaseType *ptr_duplicate();
00082
00083 virtual unsigned int width();
00084
00085
00086
00087 unsigned int length();
00088
00089 virtual bool serialize(ConstraintEvaluator &eval, DDS &dds,
00090 Marshaller &m, bool ce_eval = true);
00091 virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false);
00092
00093 virtual unsigned int val2buf(void *val, bool reuse = false);
00094 virtual unsigned int buf2val(void **val);
00095
00096 virtual bool set_value(const string &value);
00097 virtual string value() const;
00098 #if FILE_METHODS
00099 virtual void print_val(FILE *out, string space = "",
00100 bool print_decl_p = true);
00101 #endif
00102 virtual void print_val(ostream &out, string space = "",
00103 bool print_decl_p = true);
00104
00105 virtual bool ops(BaseType *b, int op);
00106
00107 virtual void dump(ostream &strm) const ;
00108 };
00109
00110 }
00111
00112 #endif // _str_h
00113