32 #ifndef VLXVisitorExportToVLT_INCLUDE_ONCE 33 #define VLXVisitorExportToVLT_INCLUDE_ONCE 52 mFormatBuffer.resize(4096);
59 std::map< std::string, int >::iterator it = mIDSet->find(uid);
60 if (it != mIDSet->end())
61 return it->second > 1;
82 case 1:
output(
"\t");
break;
83 case 2:
output(
"\t\t");
break;
84 case 3:
output(
"\t\t\t");
break;
85 case 4:
output(
"\t\t\t\t");
break;
86 case 5:
output(
"\t\t\t\t\t");
break;
87 case 6:
output(
"\t\t\t\t\t\t");
break;
88 case 7:
output(
"\t\t\t\t\t\t\t");
break;
89 case 8:
output(
"\t\t\t\t\t\t\t\t");
break;
90 case 9:
output(
"\t\t\t\t\t\t\t\t\t");
break;
92 output(
"\t\t\t\t\t\t\t\t\t");
93 for(
int i=9; i<mIndent; ++i)
101 mFormatBuffer[0] = 0;
105 vsnprintf(&mFormatBuffer[0], mFormatBuffer.size(), fmt, ap);
108 output(&mFormatBuffer[0]);
148 if (!fblock->
tag().empty())
189 if (obj->
tag().empty())
207 if ( obj->
uid().length() && obj->
uid() !=
"#NULL" &&
isUsed(obj->
uid()) )
212 for(
size_t i=0; i<obj->
value().size(); ++i)
231 if (list->
value().size() == 0)
238 if (list->
tag().empty())
256 for(
size_t i=0; i<list->
value().size(); ++i)
267 int size = (int)arr->
value().size() - 10;
268 for( ; i < size; i += 10)
270 format(
"%lld %lld %lld %lld %lld %lld %lld %lld %lld %lld ",
274 for( ; i < (int)arr->
value().size(); ++i )
285 int size = (int)arr->
value().size() - 10;
286 for( ; i < size; i += 10)
288 format(
"%f %f %f %f %f %f %f %f %f %f ",
292 for( ; i < (int)arr->
value().size(); ++i )
329 for(
size_t i=0; str[i]; ++i)
331 if ( str[i] ==
'}' && !out.empty() && out[ out.size()-1 ] ==
'>')
333 out.resize( out.size() - 1 );
337 out.push_back( str[i] );
346 for(
size_t i=0; str[i]; ++i)
374 const std::string&
text()
const {
return mText; }
376 std::string&
text() {
return mText; }
378 virtual void output(
const std::string& str)
394 void setIDSet(std::map< std::string, int >* uids) { mIDSet = uids; }
396 std::map< std::string, int >*
uidSet() {
return mIDSet; }
398 const std::map< std::string, int >*
uidSet()
const {
return mIDSet; }
404 std::map< std::string, int >* mIDSet;
405 std::vector<char> mFormatBuffer;
VLXRawtextBlock * getRawtextBlock()
Wrapper for all VLX value types.
virtual void acceptVisitor(Visitor *v)
static void warning(const String &message)
Use this function to provide information about situations that might lead to errors or loss of data...
virtual void output(const std::string &str)
bool isUsed(const std::string &uid)
An array of 64 bits floating point numbers, can also have a tag.
const std::string & text() const
const std::string & getID() const
virtual void acceptVisitor(Visitor *v)
VLXStructure * getStructure()
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
std::vector< VLXValue > & value()
void setIDSet(std::map< std::string, int > *uids)
long long getInteger() const
A list of key/VLXValue pairs, can also have a tag.
virtual void visitStructure(VLXStructure *obj)
void format(const char *fmt,...)
A simple sequence of VLXValue objects, can also have a tag.
#define VL_SERIALIZER_VERSION
const std::string & tag() const
std::string stringEncode(const char *str)
virtual void acceptVisitor(Visitor *v)
std::vector< KeyValue > & value()
An array of 64 bits integers, can also have a tag.
virtual void visitArray(VLXArrayInteger *arr)
virtual void visitArray(VLXArrayReal *arr)
std::vector< T > & value()
Base class for all visitors visiting a VLX hierarchy.
const std::map< std::string, int > * uidSet() const
const std::string & uid() const
void visitValue(VLXValue &value)
VLXArrayInteger * getArrayInteger()
static String printf(const char *fmt,...)
Returns a formatted string using the legacy printf syntax. The resulting string can be maximum 1024 +...
std::string toStdString() const
Returns a UTF8 encoded std::string.
bool isVisited(void *node)
virtual void visitList(VLXList *list)
const std::string & getString() const
virtual void output(const char *str)
virtual void acceptVisitor(Visitor *v)
Translates a VLX hierarchy into VLT notation.
std::map< std::string, int > * uidSet()
VLXArrayReal * getArrayReal()
std::string rawtextEncode(const char *str)
const std::string & getIdentifier() const