emitter.cpp
Go to the documentation of this file.
1 #include "yaml-cpp-pm/emitter.h"
2 #include "emitterstate.h"
3 #include "emitterutils.h"
4 #include "indentation.h"
6 #include <sstream>
7 
8 namespace YAML_PM
9 {
10  Emitter::Emitter(): m_pState(new EmitterState)
11  {
12  }
13 
15  {
16  }
17 
18  const char *Emitter::c_str() const
19  {
20  return m_stream.str();
21  }
22 
23  unsigned Emitter::size() const
24  {
25  return m_stream.pos();
26  }
27 
28  // state checking
29  bool Emitter::good() const
30  {
31  return m_pState->good();
32  }
33 
35  {
36  return m_pState->GetLastError();
37  }
38 
39  // global setters
41  {
42  return m_pState->SetOutputCharset(value, GLOBAL);
43  }
44 
46  {
47  return m_pState->SetStringFormat(value, GLOBAL);
48  }
49 
51  {
52  bool ok = false;
53  if(m_pState->SetBoolFormat(value, GLOBAL))
54  ok = true;
55  if(m_pState->SetBoolCaseFormat(value, GLOBAL))
56  ok = true;
57  if(m_pState->SetBoolLengthFormat(value, GLOBAL))
58  ok = true;
59  return ok;
60  }
61 
63  {
64  return m_pState->SetIntFormat(value, GLOBAL);
65  }
66 
68  {
69  return m_pState->SetFlowType(GT_SEQ, value, GLOBAL);
70  }
71 
73  {
74  bool ok = false;
75  if(m_pState->SetFlowType(GT_MAP, value, GLOBAL))
76  ok = true;
77  if(m_pState->SetMapKeyFormat(value, GLOBAL))
78  ok = true;
79  return ok;
80  }
81 
82  bool Emitter::SetIndent(unsigned n)
83  {
84  return m_pState->SetIndent(n, GLOBAL);
85  }
86 
88  {
89  return m_pState->SetPreCommentIndent(n, GLOBAL);
90  }
91 
93  {
94  return m_pState->SetPostCommentIndent(n, GLOBAL);
95  }
96 
97  bool Emitter::SetFloatPrecision(unsigned n)
98  {
99  return m_pState->SetFloatPrecision(n, GLOBAL);
100  }
101 
103  {
104  return m_pState->SetDoublePrecision(n, GLOBAL);
105  }
106 
107  // SetLocalValue
108  // . Either start/end a group, or set a modifier locally
110  {
111  if(!good())
112  return *this;
113 
114  switch(value) {
115  case BeginDoc:
116  EmitBeginDoc();
117  break;
118  case EndDoc:
119  EmitEndDoc();
120  break;
121  case BeginSeq:
122  EmitBeginSeq();
123  break;
124  case EndSeq:
125  EmitEndSeq();
126  break;
127  case BeginMap:
128  EmitBeginMap();
129  break;
130  case EndMap:
131  EmitEndMap();
132  break;
133  case Key:
134  EmitKey();
135  break;
136  case Value:
137  EmitValue();
138  break;
139  case TagByKind:
140  EmitKindTag();
141  break;
142  case Newline:
143  EmitNewline();
144  break;
145  default:
146  m_pState->SetLocalValue(value);
147  break;
148  }
149  return *this;
150  }
151 
153  {
154  m_pState->SetIndent(indent.value, LOCAL);
155  return *this;
156  }
157 
159  {
160  if(precision.floatPrecision >= 0)
161  m_pState->SetFloatPrecision(precision.floatPrecision, LOCAL);
162  if(precision.doublePrecision >= 0)
163  m_pState->SetDoublePrecision(precision.doublePrecision, LOCAL);
164  return *this;
165  }
166 
167  // GotoNextPreAtomicState
168  // . Runs the state machine, emitting if necessary, and returns 'true' if done (i.e., ready to emit an atom)
170  {
171  if(!good())
172  return true;
173 
174  unsigned curIndent = m_pState->GetCurIndent();
175 
176  EMITTER_STATE curState = m_pState->GetCurState();
177  switch(curState) {
178  // document-level
179  case ES_WAITING_FOR_DOC:
180  m_pState->SwitchState(ES_WRITING_DOC);
181  return true;
182  case ES_WRITING_DOC:
183  return true;
184  case ES_DONE_WITH_DOC:
185  EmitBeginDoc();
186  return false;
187 
188  // block sequence
190  m_stream << IndentTo(curIndent) << "-";
191  m_pState->RequireSoftSeparation();
192  m_pState->SwitchState(ES_WRITING_BLOCK_SEQ_ENTRY);
193  return true;
195  return true;
197  m_stream << '\n';
199  return false;
200 
201  // flow sequence
203  m_pState->SwitchState(ES_WRITING_FLOW_SEQ_ENTRY);
204  return true;
206  return true;
209  m_stream << ',';
210  m_pState->RequireSoftSeparation();
212  return false;
213 
214  // block map
217  return true;
219  if(m_pState->CurrentlyInLongKey()) {
220  m_stream << IndentTo(curIndent) << '?';
221  m_pState->RequireSoftSeparation();
222  }
223  m_pState->SwitchState(ES_WRITING_BLOCK_MAP_KEY);
224  return true;
226  return true;
229  return true;
231  m_pState->SwitchState(ES_WRITING_BLOCK_MAP_VALUE);
232  return true;
234  return true;
237  return true;
238 
239  // flow map
242  return true;
245  m_pState->SwitchState(ES_WRITING_FLOW_MAP_KEY);
246  if(m_pState->CurrentlyInLongKey()) {
247  m_stream << '?';
248  m_pState->RequireSoftSeparation();
249  }
250  return true;
252  return true;
255  return true;
258  m_stream << ':';
259  m_pState->RequireSoftSeparation();
260  m_pState->SwitchState(ES_WRITING_FLOW_MAP_VALUE);
261  return true;
263  return true;
266  return true;
267  default:
268  assert(false);
269  }
270 
271  assert(false);
272  return true;
273  }
274 
275  // PreAtomicWrite
276  // . Depending on the emitter state, write to the stream to get it
277  // in position to do an atomic write (e.g., scalar, sequence, or map)
279  {
280  if(!good())
281  return;
282 
283  while(!GotoNextPreAtomicState())
284  ;
285  }
286 
287  // PostAtomicWrite
288  // . Clean up
290  {
291  if(!good())
292  return;
293 
294  EMITTER_STATE curState = m_pState->GetCurState();
295  switch(curState) {
296  // document-level
297  case ES_WRITING_DOC:
298  m_pState->SwitchState(ES_DONE_WITH_DOC);
299  break;
300 
301  // block seq
304  break;
305 
306  // flow seq
309  break;
310 
311  // block map
313  if(!m_pState->CurrentlyInLongKey()) {
314  m_stream << ':';
315  m_pState->RequireSoftSeparation();
316  }
317  m_pState->SwitchState(ES_DONE_WITH_BLOCK_MAP_KEY);
318  break;
321  break;
322 
323  // flow map
325  m_pState->SwitchState(ES_DONE_WITH_FLOW_MAP_KEY);
326  break;
329  break;
330  default:
331  assert(false);
332  };
333 
334  m_pState->ClearModifiedSettings();
335  }
336 
337  // EmitSeparationIfNecessary
339  {
340  if(!good())
341  return;
342 
343  if(m_pState->RequiresSoftSeparation())
344  m_stream << ' ';
345  else if(m_pState->RequiresHardSeparation())
346  m_stream << '\n';
347  m_pState->UnsetSeparation();
348  }
349 
350  // EmitBeginDoc
352  {
353  if(!good())
354  return;
355 
356  EMITTER_STATE curState = m_pState->GetCurState();
357  if(curState != ES_WAITING_FOR_DOC && curState != ES_WRITING_DOC && curState != ES_DONE_WITH_DOC) {
358  m_pState->SetError("Unexpected begin document");
359  return;
360  }
361 
362  if(curState == ES_WRITING_DOC || curState == ES_DONE_WITH_DOC)
363  m_stream << '\n';
364  m_stream << "---\n";
365 
366  m_pState->UnsetSeparation();
367  m_pState->SwitchState(ES_WAITING_FOR_DOC);
368  }
369 
370  // EmitEndDoc
372  {
373  if(!good())
374  return;
375 
376 
377  EMITTER_STATE curState = m_pState->GetCurState();
378  if(curState != ES_WAITING_FOR_DOC && curState != ES_WRITING_DOC && curState != ES_DONE_WITH_DOC) {
379  m_pState->SetError("Unexpected end document");
380  return;
381  }
382 
383  if(curState == ES_WRITING_DOC || curState == ES_DONE_WITH_DOC)
384  m_stream << '\n';
385  m_stream << "...\n";
386 
387  m_pState->UnsetSeparation();
388  m_pState->SwitchState(ES_WAITING_FOR_DOC);
389  }
390 
391  // EmitBeginSeq
393  {
394  if(!good())
395  return;
396 
397  // must have a long key if we're emitting a sequence
398  m_pState->StartLongKey();
399 
400  PreAtomicWrite();
401 
402  EMITTER_STATE curState = m_pState->GetCurState();
403  EMITTER_MANIP flowType = m_pState->GetFlowType(GT_SEQ);
404  if(flowType == Block) {
405  if(curState == ES_WRITING_BLOCK_SEQ_ENTRY ||
406  curState == ES_WRITING_BLOCK_MAP_KEY || curState == ES_WRITING_BLOCK_MAP_VALUE ||
407  curState == ES_WRITING_DOC
408  ) {
409  if(m_pState->RequiresHardSeparation() || curState != ES_WRITING_DOC) {
410  m_stream << "\n";
411  m_pState->UnsetSeparation();
412  }
413  }
415  } else if(flowType == Flow) {
417  m_stream << "[";
419  } else
420  assert(false);
421 
422  m_pState->BeginGroup(GT_SEQ);
423  }
424 
425  // EmitEndSeq
427  {
428  if(!good())
429  return;
430 
431  if(m_pState->GetCurGroupType() != GT_SEQ)
432  return m_pState->SetError(ErrorMsg::UNEXPECTED_END_SEQ);
433 
434  EMITTER_STATE curState = m_pState->GetCurState();
435  FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
436  if(flowType == FT_BLOCK) {
437  // Note: block sequences are *not* allowed to be empty, but we convert it
438  // to a flow sequence if it is
439  assert(curState == ES_DONE_WITH_BLOCK_SEQ_ENTRY || curState == ES_WAITING_FOR_BLOCK_SEQ_ENTRY);
440  if(curState == ES_WAITING_FOR_BLOCK_SEQ_ENTRY) {
441  // Note: only one of these will actually output anything for a given situation
443  unsigned curIndent = m_pState->GetCurIndent();
444  m_stream << IndentTo(curIndent);
445 
446  m_stream << "[]";
447  }
448  } else if(flowType == FT_FLOW) {
449  // Note: flow sequences are allowed to be empty
450  assert(curState == ES_DONE_WITH_FLOW_SEQ_ENTRY || curState == ES_WAITING_FOR_FLOW_SEQ_ENTRY);
451  m_stream << "]";
452  } else
453  assert(false);
454 
455  m_pState->PopState();
456  m_pState->EndGroup(GT_SEQ);
457 
458  PostAtomicWrite();
459  }
460 
461  // EmitBeginMap
463  {
464  if(!good())
465  return;
466 
467  // must have a long key if we're emitting a map
468  m_pState->StartLongKey();
469 
470  PreAtomicWrite();
471 
472  EMITTER_STATE curState = m_pState->GetCurState();
473  EMITTER_MANIP flowType = m_pState->GetFlowType(GT_MAP);
474  if(flowType == Block) {
475  if(curState == ES_WRITING_BLOCK_SEQ_ENTRY ||
476  curState == ES_WRITING_BLOCK_MAP_KEY || curState == ES_WRITING_BLOCK_MAP_VALUE ||
477  curState == ES_WRITING_DOC
478  ) {
479  if(m_pState->RequiresHardSeparation() || (curState != ES_WRITING_DOC && curState != ES_WRITING_BLOCK_SEQ_ENTRY)) {
480  m_stream << "\n";
481  m_pState->UnsetSeparation();
482  }
483  }
485  } else if(flowType == Flow) {
487  m_stream << "{";
489  } else
490  assert(false);
491 
492  m_pState->BeginGroup(GT_MAP);
493  }
494 
495  // EmitEndMap
497  {
498  if(!good())
499  return;
500 
501  if(m_pState->GetCurGroupType() != GT_MAP)
502  return m_pState->SetError(ErrorMsg::UNEXPECTED_END_MAP);
503 
504  EMITTER_STATE curState = m_pState->GetCurState();
505  FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
506  if(flowType == FT_BLOCK) {
507  // Note: block sequences are *not* allowed to be empty, but we convert it
508  // to a flow sequence if it is
509  assert(curState == ES_DONE_WITH_BLOCK_MAP_VALUE || curState == ES_WAITING_FOR_BLOCK_MAP_ENTRY);
510  if(curState == ES_WAITING_FOR_BLOCK_MAP_ENTRY) {
511  // Note: only one of these will actually output anything for a given situation
513  unsigned curIndent = m_pState->GetCurIndent();
514  m_stream << IndentTo(curIndent);
515  m_stream << "{}";
516  }
517  } else if(flowType == FT_FLOW) {
518  // Note: flow maps are allowed to be empty
519  assert(curState == ES_DONE_WITH_FLOW_MAP_VALUE || curState == ES_WAITING_FOR_FLOW_MAP_ENTRY);
521  m_stream << "}";
522  } else
523  assert(false);
524 
525  m_pState->PopState();
526  m_pState->EndGroup(GT_MAP);
527 
528  PostAtomicWrite();
529  }
530 
531  // EmitKey
533  {
534  if(!good())
535  return;
536 
537  EMITTER_STATE curState = m_pState->GetCurState();
538  FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
540  && curState != ES_WAITING_FOR_FLOW_MAP_ENTRY && curState != ES_DONE_WITH_FLOW_MAP_VALUE)
541  return m_pState->SetError(ErrorMsg::UNEXPECTED_KEY_TOKEN);
542 
543  if(flowType == FT_BLOCK) {
544  if(curState == ES_DONE_WITH_BLOCK_MAP_VALUE)
545  m_stream << '\n';
546  unsigned curIndent = m_pState->GetCurIndent();
547  m_stream << IndentTo(curIndent);
548  m_pState->UnsetSeparation();
550  } else if(flowType == FT_FLOW) {
552  if(curState == ES_DONE_WITH_FLOW_MAP_VALUE) {
553  m_stream << ',';
554  m_pState->RequireSoftSeparation();
555  }
557  } else
558  assert(false);
559 
560  if(m_pState->GetMapKeyFormat() == LongKey)
561  m_pState->StartLongKey();
562  else if(m_pState->GetMapKeyFormat() == Auto)
563  m_pState->StartSimpleKey();
564  else
565  assert(false);
566  }
567 
568  // EmitValue
570  {
571  if(!good())
572  return;
573 
574  EMITTER_STATE curState = m_pState->GetCurState();
575  FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
576  if(curState != ES_DONE_WITH_BLOCK_MAP_KEY && curState != ES_DONE_WITH_FLOW_MAP_KEY)
577  return m_pState->SetError(ErrorMsg::UNEXPECTED_VALUE_TOKEN);
578 
579  if(flowType == FT_BLOCK) {
580  if(m_pState->CurrentlyInLongKey()) {
581  m_stream << '\n';
582  m_stream << IndentTo(m_pState->GetCurIndent());
583  m_stream << ':';
584  m_pState->RequireSoftSeparation();
585  }
587  } else if(flowType == FT_FLOW) {
589  } else
590  assert(false);
591  }
592 
593  // EmitNewline
595  {
596  if(!good())
597  return;
598 
599  if(CanEmitNewline()) {
600  m_stream << '\n';
601  m_pState->UnsetSeparation();
602  }
603  }
604 
606  {
607  FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
608  if(flowType == FT_BLOCK && m_pState->CurrentlyInLongKey())
609  return true;
610 
611  EMITTER_STATE curState = m_pState->GetCurState();
612  return curState != ES_DONE_WITH_BLOCK_MAP_KEY && curState != ES_WAITING_FOR_BLOCK_MAP_VALUE && curState != ES_WRITING_BLOCK_MAP_VALUE;
613  }
614 
615  // *******************************************************************************************
616  // overloads of Write
617 
619  {
620  if(!good())
621  return *this;
622 
623  // literal scalars must use long keys
624  if(m_pState->GetStringFormat() == Literal && m_pState->GetCurGroupFlowType() != FT_FLOW)
625  m_pState->StartLongKey();
626 
627  PreAtomicWrite();
629 
630  bool escapeNonAscii = m_pState->GetOutputCharset() == EscapeNonAscii;
631  EMITTER_MANIP strFmt = m_pState->GetStringFormat();
632  FLOW_TYPE flowType = m_pState->GetCurGroupFlowType();
633  unsigned curIndent = m_pState->GetCurIndent();
634 
635  switch(strFmt) {
636  case Auto:
637  Utils::WriteString(m_stream, str, flowType == FT_FLOW, escapeNonAscii);
638  break;
639  case SingleQuoted:
642  return *this;
643  }
644  break;
645  case DoubleQuoted:
646  Utils::WriteDoubleQuotedString(m_stream, str, escapeNonAscii);
647  break;
648  case Literal:
649  if(flowType == FT_FLOW)
650  Utils::WriteString(m_stream, str, flowType == FT_FLOW, escapeNonAscii);
651  else
652  Utils::WriteLiteralString(m_stream, str, curIndent + m_pState->GetIndent());
653  break;
654  default:
655  assert(false);
656  }
657 
658  PostAtomicWrite();
659  return *this;
660  }
661 
662  void Emitter::PreWriteIntegralType(std::stringstream& str)
663  {
664  PreAtomicWrite();
666 
667  EMITTER_MANIP intFmt = m_pState->GetIntFormat();
668  switch(intFmt) {
669  case Dec:
670  str << std::dec;
671  break;
672  case Hex:
673  str << "0x";
674  str << std::hex;
675  break;
676  case Oct:
677  str << "0";
678  str << std::oct;
679  break;
680  default:
681  assert(false);
682  }
683  }
684 
685  void Emitter::PreWriteStreamable(std::stringstream&)
686  {
687  PreAtomicWrite();
689  }
690 
691  unsigned Emitter::GetFloatPrecision() const
692  {
693  return m_pState->GetFloatPrecision();
694  }
695 
697  {
698  return m_pState->GetDoublePrecision();
699  }
700 
701  void Emitter::PostWriteIntegralType(const std::stringstream& str)
702  {
703  m_stream << str.str();
704  PostAtomicWrite();
705  }
706 
707  void Emitter::PostWriteStreamable(const std::stringstream& str)
708  {
709  m_stream << str.str();
710  PostAtomicWrite();
711  }
712 
713  const char *Emitter::ComputeFullBoolName(bool b) const
714  {
715  const EMITTER_MANIP mainFmt = (m_pState->GetBoolLengthFormat() == ShortBool ? YesNoBool : m_pState->GetBoolFormat());
716  const EMITTER_MANIP caseFmt = m_pState->GetBoolCaseFormat();
717  switch(mainFmt) {
718  case YesNoBool:
719  switch(caseFmt) {
720  case UpperCase: return b ? "YES" : "NO";
721  case CamelCase: return b ? "Yes" : "No";
722  case LowerCase: return b ? "yes" : "no";
723  default: break;
724  }
725  break;
726  case OnOffBool:
727  switch(caseFmt) {
728  case UpperCase: return b ? "ON" : "OFF";
729  case CamelCase: return b ? "On" : "Off";
730  case LowerCase: return b ? "on" : "off";
731  default: break;
732  }
733  break;
734  case TrueFalseBool:
735  switch(caseFmt) {
736  case UpperCase: return b ? "TRUE" : "FALSE";
737  case CamelCase: return b ? "True" : "False";
738  case LowerCase: return b ? "true" : "false";
739  default: break;
740  }
741  break;
742  default:
743  break;
744  }
745  return b ? "y" : "n"; // should never get here, but it can't hurt to give these answers
746  }
747 
749  {
750  if(!good())
751  return *this;
752 
753  PreAtomicWrite();
755 
756  const char *name = ComputeFullBoolName(b);
757  if(m_pState->GetBoolLengthFormat() == ShortBool)
758  m_stream << name[0];
759  else
760  m_stream << name;
761 
762  PostAtomicWrite();
763  return *this;
764  }
765 
767  {
768  if(!good())
769  return *this;
770 
771  PreAtomicWrite();
773 
775 
776  PostAtomicWrite();
777  return *this;
778  }
779 
781  {
782  if(!good())
783  return *this;
784 
785  PreAtomicWrite();
787  if(!Utils::WriteAlias(m_stream, alias.content)) {
789  return *this;
790  }
791  PostAtomicWrite();
792  return *this;
793  }
794 
796  {
797  if(!good())
798  return *this;
799 
800  PreAtomicWrite();
802  if(!Utils::WriteAnchor(m_stream, anchor.content)) {
804  return *this;
805  }
806  m_pState->RequireHardSeparation();
807  // Note: no PostAtomicWrite() because we need another value for this node
808  return *this;
809  }
810 
812  {
813  if(!good())
814  return *this;
815 
816  PreAtomicWrite();
818 
819  bool success = false;
820  if(tag.type == _Tag::Type::Verbatim)
821  success = Utils::WriteTag(m_stream, tag.content, true);
822  else if(tag.type == _Tag::Type::PrimaryHandle)
823  success = Utils::WriteTag(m_stream, tag.content, false);
824  else
825  success = Utils::WriteTagWithPrefix(m_stream, tag.prefix, tag.content);
826 
827  if(!success) {
828  m_pState->SetError(ErrorMsg::INVALID_TAG);
829  return *this;
830  }
831 
832  m_pState->RequireHardSeparation();
833  // Note: no PostAtomicWrite() because we need another value for this node
834  return *this;
835  }
836 
838  {
839  Write(LocalTag(""));
840  }
841 
842  Emitter& Emitter::Write(const _Comment& comment)
843  {
844  if(!good())
845  return *this;
846 
847  if(m_stream.col() > 0)
848  m_stream << Indentation(m_pState->GetPreCommentIndent());
849  Utils::WriteComment(m_stream, comment.content, m_pState->GetPostCommentIndent());
850  m_pState->RequireHardSeparation();
851  m_pState->ForceHardSeparation();
852 
853  return *this;
854  }
855 
856  Emitter& Emitter::Write(const _Null& /*null*/)
857  {
858  if(!good())
859  return *this;
860 
861  PreAtomicWrite();
863  m_stream << "~";
864  PostAtomicWrite();
865  return *this;
866  }
867 
868  Emitter& Emitter::Write(const Binary& binary)
869  {
870  Write(SecondaryTag("binary"));
871 
872  if(!good())
873  return *this;
874 
875  PreAtomicWrite();
877  Utils::WriteBinary(m_stream, binary);
878  PostAtomicWrite();
879  return *this;
880  }
881 }
882 
YAML_PM::Emitter::EmitEndDoc
void EmitEndDoc()
Definition: emitter.cpp:371
YAML_PM::Emitter::GetFloatPrecision
unsigned GetFloatPrecision() const
Definition: emitter.cpp:691
YAML_PM::Emitter::SetFloatPrecision
bool SetFloatPrecision(unsigned n)
Definition: emitter.cpp:97
YAML_PM::Oct
@ Oct
Definition: emittermanip.h:42
YAML_PM::Literal
@ Literal
Definition: emittermanip.h:27
YAML_PM::Utils::WriteSingleQuotedString
bool WriteSingleQuotedString(ostream &out, const std::string &str)
Definition: emitterutils.cpp:210
YAML_PM::ES_WRITING_BLOCK_MAP_KEY
@ ES_WRITING_BLOCK_MAP_KEY
Definition: emitterstate.h:60
YAML_PM::ostream::str
const char * str() const
Definition: ostream.h:21
exceptions.h
YAML_PM::Emitter::SetIndent
bool SetIndent(unsigned n)
Definition: emitter.cpp:82
YAML_PM::ES_WRITING_DOC
@ ES_WRITING_DOC
Definition: emitterstate.h:44
YAML_PM::Emitter::PostAtomicWrite
void PostAtomicWrite()
Definition: emitter.cpp:289
YAML_PM::ES_WRITING_BLOCK_SEQ_ENTRY
@ ES_WRITING_BLOCK_SEQ_ENTRY
Definition: emitterstate.h:49
YAML_PM::ES_DONE_WITH_BLOCK_MAP_KEY
@ ES_DONE_WITH_BLOCK_MAP_KEY
Definition: emitterstate.h:61
YAML_PM::ES_WRITING_FLOW_SEQ_ENTRY
@ ES_WRITING_FLOW_SEQ_ENTRY
Definition: emitterstate.h:54
YAML_PM::Utils::WriteComment
bool WriteComment(ostream &out, const std::string &str, int postCommentIndent)
Definition: emitterutils.cpp:292
YAML_PM::Utils::WriteChar
bool WriteChar(ostream &out, char ch)
Definition: emitterutils.cpp:272
YAML_PM::Emitter::EmitKey
void EmitKey()
Definition: emitter.cpp:532
YAML_PM::Emitter::SetLocalValue
Emitter & SetLocalValue(EMITTER_MANIP value)
Definition: emitter.cpp:109
YAML_PM::_Tag::Type::Verbatim
@ Verbatim
Definition: emittermanip.h:93
YAML_PM
Definition: aliasmanager.h:11
YAML_PM::_Anchor
Definition: emittermanip.h:83
YAML_PM::CamelCase
@ CamelCase
Definition: emittermanip.h:35
YAML_PM::Emitter::GotoNextPreAtomicState
bool GotoNextPreAtomicState()
Definition: emitter.cpp:169
YAML_PM::Binary
Definition: binary.h:18
YAML_PM::_Tag::Type::PrimaryHandle
@ PrimaryHandle
Definition: emittermanip.h:93
YAML_PM::Emitter::EmitBeginSeq
void EmitBeginSeq()
Definition: emitter.cpp:392
YAML_PM::ErrorMsg::INVALID_ALIAS
const char *const INVALID_ALIAS
Definition: exceptions.h:67
YAML_PM::Utils::WriteString
bool WriteString(ostream &out, const std::string &str, bool inFlow, bool escapeNonAscii)
Definition: emitterutils.cpp:201
YAML_PM::ShortBool
@ ShortBool
Definition: emittermanip.h:37
YAML_PM::LongKey
@ LongKey
Definition: emittermanip.h:62
YAML_PM::Indentation
Definition: indentation.h:14
YAML_PM::Emitter::EmitBeginDoc
void EmitBeginDoc()
Definition: emitter.cpp:351
YAML_PM::ErrorMsg::SINGLE_QUOTED_CHAR
const char *const SINGLE_QUOTED_CHAR
Definition: exceptions.h:65
YAML_PM::ES_WAITING_FOR_FLOW_MAP_VALUE
@ ES_WAITING_FOR_FLOW_MAP_VALUE
Definition: emitterstate.h:71
YAML_PM::Emitter::good
bool good() const
Definition: emitter.cpp:29
YAML_PM::ErrorMsg::INVALID_TAG
const char *const INVALID_TAG
Definition: exceptions.h:68
YAML_PM::ErrorMsg::EXPECTED_KEY_TOKEN
const char *const EXPECTED_KEY_TOKEN
Definition: exceptions.h:69
YAML_PM::Emitter::c_str
const char * c_str() const
Definition: emitter.cpp:18
YAML_PM::Emitter::CanEmitNewline
bool CanEmitNewline() const
Definition: emitter.cpp:605
YAML_PM::EMITTER_STATE
EMITTER_STATE
Definition: emitterstate.h:42
YAML_PM::DoubleQuoted
@ DoubleQuoted
Definition: emittermanip.h:26
YAML_PM::ErrorMsg::UNEXPECTED_END_MAP
const char *const UNEXPECTED_END_MAP
Definition: exceptions.h:64
YAML_PM::FLOW_TYPE
FLOW_TYPE
Definition: emitterstate.h:30
YAML_PM::Flow
@ Flow
Definition: emittermanip.h:51
YAML_PM::Emitter::PreWriteIntegralType
void PreWriteIntegralType(std::stringstream &str)
Definition: emitter.cpp:662
YAML_PM::SecondaryTag
_Tag SecondaryTag(const std::string content)
Definition: emittermanip.h:116
YAML_PM::Emitter::SetSeqFormat
bool SetSeqFormat(EMITTER_MANIP value)
Definition: emitter.cpp:67
YAML_PM::ES_WAITING_FOR_FLOW_SEQ_ENTRY
@ ES_WAITING_FOR_FLOW_SEQ_ENTRY
Definition: emitterstate.h:53
YAML_PM::Emitter::PreAtomicWrite
void PreAtomicWrite()
Definition: emitter.cpp:278
YAML_PM::Emitter::SetIntBase
bool SetIntBase(EMITTER_MANIP value)
Definition: emitter.cpp:62
ok
ROSCPP_DECL bool ok()
YAML_PM::Hex
@ Hex
Definition: emittermanip.h:41
YAML_PM::ES_WAITING_FOR_BLOCK_MAP_ENTRY
@ ES_WAITING_FOR_BLOCK_MAP_ENTRY
Definition: emitterstate.h:58
YAML_PM::Emitter::PostWriteStreamable
void PostWriteStreamable(const std::stringstream &str)
Definition: emitter.cpp:707
YAML_PM::_Tag::prefix
std::string prefix
Definition: emittermanip.h:99
YAML_PM::Block
@ Block
Definition: emittermanip.h:52
testing::internal::string
::std::string string
Definition: gtest.h:1979
YAML_PM::Emitter::EmitKindTag
void EmitKindTag()
Definition: emitter.cpp:837
YAML_PM::_Precision
Definition: emittermanip.h:129
YAML_PM::ErrorMsg::UNEXPECTED_END_SEQ
const char *const UNEXPECTED_END_SEQ
Definition: exceptions.h:63
YAML_PM::TrueFalseBool
@ TrueFalseBool
Definition: emittermanip.h:31
YAML_PM::ES_DONE_WITH_FLOW_MAP_VALUE
@ ES_DONE_WITH_FLOW_MAP_VALUE
Definition: emitterstate.h:73
YAML_PM::ES_WAITING_FOR_BLOCK_MAP_KEY
@ ES_WAITING_FOR_BLOCK_MAP_KEY
Definition: emitterstate.h:59
YAML_PM::ErrorMsg::UNEXPECTED_KEY_TOKEN
const char *const UNEXPECTED_KEY_TOKEN
Definition: exceptions.h:71
YAML_PM::BeginMap
@ BeginMap
Definition: emittermanip.h:55
YAML_PM::_Indent
Definition: emittermanip.h:65
YAML_PM::Emitter::EmitEndMap
void EmitEndMap()
Definition: emitter.cpp:496
YAML_PM::ErrorMsg::INVALID_ANCHOR
const char *const INVALID_ANCHOR
Definition: exceptions.h:66
YAML_PM::ES_DONE_WITH_FLOW_SEQ_ENTRY
@ ES_DONE_WITH_FLOW_SEQ_ENTRY
Definition: emitterstate.h:55
YAML_PM::EndSeq
@ EndSeq
Definition: emittermanip.h:50
YAML_PM::GT_MAP
@ GT_MAP
Definition: emitterstate.h:27
YAML_PM::UpperCase
@ UpperCase
Definition: emittermanip.h:33
YAML_PM::SingleQuoted
@ SingleQuoted
Definition: emittermanip.h:25
YAML_PM::Utils::WriteTagWithPrefix
bool WriteTagWithPrefix(ostream &out, const std::string &prefix, const std::string &tag)
Definition: emitterutils.cpp:341
indentation.h
YAML_PM::Emitter::SetPostCommentIndent
bool SetPostCommentIndent(unsigned n)
Definition: emitter.cpp:92
YAML_PM::OnOffBool
@ OnOffBool
Definition: emittermanip.h:32
YAML_PM::Emitter::SetStringFormat
bool SetStringFormat(EMITTER_MANIP value)
Definition: emitter.cpp:45
YAML_PM::Utils::WriteBinary
bool WriteBinary(ostream &out, const Binary &binary)
Definition: emitterutils.cpp:371
YAML_PM::Emitter::EmitValue
void EmitValue()
Definition: emitter.cpp:569
YAML_PM::ostream::pos
unsigned pos() const
Definition: ostream.h:25
YAML_PM::GLOBAL
@ GLOBAL
Definition: emitterstate.h:21
emitterstate.h
YAML_PM::Auto
@ Auto
Definition: emittermanip.h:15
YAML_PM::_Anchor::content
std::string content
Definition: emittermanip.h:85
YAML_PM::Emitter::m_pState
std::auto_ptr< EmitterState > m_pState
Definition: emitter.h:105
YAML_PM::_Tag
Definition: emittermanip.h:92
YAML_PM::FT_BLOCK
@ FT_BLOCK
Definition: emitterstate.h:33
YAML_PM::_Comment::content
std::string content
Definition: emittermanip.h:122
YAML_PM::ES_DONE_WITH_BLOCK_SEQ_ENTRY
@ ES_DONE_WITH_BLOCK_SEQ_ENTRY
Definition: emitterstate.h:50
YAML_PM::_Precision::floatPrecision
int floatPrecision
Definition: emittermanip.h:132
YAML_PM::_Precision::doublePrecision
int doublePrecision
Definition: emittermanip.h:133
YAML_PM::ES_WAITING_FOR_DOC
@ ES_WAITING_FOR_DOC
Definition: emitterstate.h:43
YAML_PM::Dec
@ Dec
Definition: emittermanip.h:40
YAML_PM::_Indent::value
int value
Definition: emittermanip.h:67
YAML_PM::ES_WAITING_FOR_FLOW_MAP_ENTRY
@ ES_WAITING_FOR_FLOW_MAP_ENTRY
Definition: emitterstate.h:67
YAML_PM::Emitter::SetDoublePrecision
bool SetDoublePrecision(unsigned n)
Definition: emitter.cpp:102
YAML_PM::Emitter::SetBoolFormat
bool SetBoolFormat(EMITTER_MANIP value)
Definition: emitter.cpp:50
YAML_PM::Value
@ Value
Definition: emittermanip.h:58
YAML_PM::Utils::WriteAnchor
bool WriteAnchor(ostream &out, const std::string &str)
Definition: emitterutils.cpp:315
YAML_PM::ErrorMsg::EXPECTED_VALUE_TOKEN
const char *const EXPECTED_VALUE_TOKEN
Definition: exceptions.h:70
YAML_PM::ES_DONE_WITH_DOC
@ ES_DONE_WITH_DOC
Definition: emitterstate.h:45
YAML_PM::IndentTo
Definition: indentation.h:25
YAML_PM::YesNoBool
@ YesNoBool
Definition: emittermanip.h:30
YAML_PM::Emitter::GetLastError
const std::string GetLastError() const
Definition: emitter.cpp:34
YAML_PM::ES_WAITING_FOR_BLOCK_MAP_VALUE
@ ES_WAITING_FOR_BLOCK_MAP_VALUE
Definition: emitterstate.h:62
YAML_PM::Utils::WriteTag
bool WriteTag(ostream &out, const std::string &str, bool verbatim)
Definition: emitterutils.cpp:321
YAML_PM::BeginDoc
@ BeginDoc
Definition: emittermanip.h:45
YAML_PM::Utils::WriteLiteralString
bool WriteLiteralString(ostream &out, const std::string &str, int indent)
Definition: emitterutils.cpp:255
YAML_PM::EMITTER_MANIP
EMITTER_MANIP
Definition: emittermanip.h:13
YAML_PM::ES_WRITING_FLOW_MAP_KEY
@ ES_WRITING_FLOW_MAP_KEY
Definition: emitterstate.h:69
YAML_PM::Emitter::~Emitter
~Emitter()
Definition: emitter.cpp:14
YAML_PM::_Alias::content
std::string content
Definition: emittermanip.h:76
YAML_PM::EmitterState
Definition: emitterstate.h:76
YAML_PM::Emitter::GetDoublePrecision
unsigned GetDoublePrecision() const
Definition: emitter.cpp:696
YAML_PM::ES_DONE_WITH_BLOCK_MAP_VALUE
@ ES_DONE_WITH_BLOCK_MAP_VALUE
Definition: emitterstate.h:64
YAML_PM::Emitter
Definition: emitter.h:23
YAML_PM::EscapeNonAscii
@ EscapeNonAscii
Definition: emittermanip.h:21
YAML_PM::GT_SEQ
@ GT_SEQ
Definition: emitterstate.h:26
YAML_PM::Emitter::SetOutputCharset
bool SetOutputCharset(EMITTER_MANIP value)
Definition: emitter.cpp:40
YAML_PM::Emitter::PreWriteStreamable
void PreWriteStreamable(std::stringstream &str)
Definition: emitter.cpp:685
YAML_PM::LOCAL
@ LOCAL
Definition: emitterstate.h:20
YAML_PM::Emitter::m_stream
ostream m_stream
Definition: emitter.h:104
YAML_PM::Emitter::SetPreCommentIndent
bool SetPreCommentIndent(unsigned n)
Definition: emitter.cpp:87
YAML_PM::Emitter::Emitter
Emitter()
Definition: emitter.cpp:10
YAML_PM::Emitter::size
unsigned size() const
Definition: emitter.cpp:23
YAML_PM::Emitter::EmitBeginMap
void EmitBeginMap()
Definition: emitter.cpp:462
YAML_PM::Utils::WriteDoubleQuotedString
bool WriteDoubleQuotedString(ostream &out, const std::string &str, bool escapeNonAscii)
Definition: emitterutils.cpp:230
YAML_PM::_Comment
Definition: emittermanip.h:120
YAML_PM::ErrorMsg::UNEXPECTED_VALUE_TOKEN
const char *const UNEXPECTED_VALUE_TOKEN
Definition: exceptions.h:72
YAML_PM::ES_WAITING_FOR_BLOCK_SEQ_ENTRY
@ ES_WAITING_FOR_BLOCK_SEQ_ENTRY
Definition: emitterstate.h:48
YAML_PM::BeginSeq
@ BeginSeq
Definition: emittermanip.h:49
YAML_PM::Utils::WriteAlias
bool WriteAlias(ostream &out, const std::string &str)
Definition: emitterutils.cpp:309
YAML_PM::Emitter::SetLocalPrecision
Emitter & SetLocalPrecision(const _Precision &precision)
Definition: emitter.cpp:158
YAML_PM::_Tag::content
std::string content
Definition: emittermanip.h:100
YAML_PM::_Alias
Definition: emittermanip.h:74
YAML_PM::ES_WRITING_FLOW_MAP_VALUE
@ ES_WRITING_FLOW_MAP_VALUE
Definition: emitterstate.h:72
YAML_PM::Emitter::EmitSeparationIfNecessary
void EmitSeparationIfNecessary()
Definition: emitter.cpp:338
YAML_PM::Emitter::PostWriteIntegralType
void PostWriteIntegralType(const std::stringstream &str)
Definition: emitter.cpp:701
YAML_PM::LowerCase
@ LowerCase
Definition: emittermanip.h:34
YAML_PM::FT_FLOW
@ FT_FLOW
Definition: emitterstate.h:32
YAML_PM::TagByKind
@ TagByKind
Definition: emittermanip.h:16
YAML_PM::Newline
@ Newline
Definition: emittermanip.h:17
YAML_PM::Emitter::SetLocalIndent
Emitter & SetLocalIndent(const _Indent &indent)
Definition: emitter.cpp:152
YAML_PM::Emitter::SetMapFormat
bool SetMapFormat(EMITTER_MANIP value)
Definition: emitter.cpp:72
YAML_PM::Emitter::ComputeFullBoolName
const char * ComputeFullBoolName(bool b) const
Definition: emitter.cpp:713
YAML_PM::Emitter::EmitNewline
void EmitNewline()
Definition: emitter.cpp:594
YAML_PM::_Null
Definition: null.h:15
emitter.h
YAML_PM::EndDoc
@ EndDoc
Definition: emittermanip.h:46
YAML_PM::ES_DONE_WITH_FLOW_MAP_KEY
@ ES_DONE_WITH_FLOW_MAP_KEY
Definition: emitterstate.h:70
YAML_PM::ostream::col
unsigned col() const
Definition: ostream.h:24
YAML_PM::_Tag::type
Type::value type
Definition: emittermanip.h:101
emitterutils.h
YAML_PM::EndMap
@ EndMap
Definition: emittermanip.h:56
YAML_PM::ES_WRITING_BLOCK_MAP_VALUE
@ ES_WRITING_BLOCK_MAP_VALUE
Definition: emitterstate.h:63
YAML_PM::Emitter::EmitEndSeq
void EmitEndSeq()
Definition: emitter.cpp:426
YAML_PM::Key
@ Key
Definition: emittermanip.h:57
YAML_PM::LocalTag
_Tag LocalTag(const std::string content)
Definition: emittermanip.h:108
YAML_PM::ES_WAITING_FOR_FLOW_MAP_KEY
@ ES_WAITING_FOR_FLOW_MAP_KEY
Definition: emitterstate.h:68
YAML_PM::Emitter::Write
Emitter & Write(const std::string &str)
Definition: emitter.cpp:618


mp2p_icp
Author(s):
autogenerated on Wed Oct 23 2024 02:45:39