5 #include <libutl/AutoPtr.h> 6 #include <libutl/Encoder.h> 7 #include <libutl/Hashtable.h> 8 #include <libutl/Mapping.h> 9 #include <libutl/MemStream.h> 10 #include <libutl/Pair.h> 50 bool mappingOwner =
true,
51 bool rememberMappings =
false,
54 set(stream, owner, mapping, mappingOwner, rememberMappings, prefix);
65 _xlats +=
new Pair(lhs.clone(), rhs.clone());
73 _xlats.dump(os, level);
76 virtual size_t encode(
const byte_t* block,
size_t num);
96 return getFlag(flg_rememberMappings);
103 return getFlag(flg_mappingOwner);
119 bool mappingOwner =
true,
120 bool rememberMappings =
false,
133 if (isMappingOwner())
delete _mapping;
135 setFlag(flg_mappingOwner, mappingOwner);
136 setFlag(flg_rememberMappings, rememberMappings);
157 flg_mappingOwner = 12,
190 bool mappingOwner =
true,
191 bool rememberMappings =
true,
194 set(mapping, mappingOwner, rememberMappings, prefix);
206 bool mappingOwner =
true,
207 bool rememberMappings =
true,
218 _translator.add(lhs, rhs);
224 _translator.dump(os, level);
244 _translator.set(
nullptr);
void deInit()
De-initialize UTL++.
Encoder/decoder abstraction.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
unsigned char byte_t
Unsigned character.
void add(const String &lhs, const String &rhs)
Add a mapping.
void setMapping(Mapping *mapping, bool mappingOwner=true, bool rememberMappings=false)
Set the mapping object.
virtual size_t decode(byte_t *block, size_t num)
Decode data from the associated stream.
void add(const String &lhs, const String &rhs)
Add a mapping.
virtual void dump(Stream &os, uint_t level=uint_t_max) const
Dump a human-readable representation of self to the given output stream.
unsigned int uint_t
Unsigned integer.
bool isMappingOwner() const
Get the mappingOwner flag.
#define ABORT()
Immediately terminates the program.
const uint_t uint_t_max
Maximum uint_t value.
Abstraction for object->object mapping.
Chained hashing collection.
Translator(Stream *stream, bool owner=true, Mapping *mapping=nullptr, bool mappingOwner=true, bool rememberMappings=false, char prefix='$')
Constructor.
virtual void dump(Stream &os, uint_t level=uint_t_max) const
Dump a human-readable representation of self to the given output stream.
Simple container for two objects.
const Mapping * getMapping() const
Get the mapping.
bool getRememberMappings() const
Get the rememberMappings flag.
Root of UTL++ class hierarchy.
A "smart" pointer that can also be dumb.
void init()
Initialize UTL++.