Wrapper for the LibYAML emitter.
More...
#include <Emitter.h>
Wrapper for the LibYAML emitter.
HoverRace::Util::yaml::Emitter::Emitter |
( |
| ) |
|
|
privatedelete |
HoverRace::Util::yaml::Emitter::Emitter |
( |
FILE * |
file, |
|
|
bool |
versionDirective = true |
|
) |
| |
Create a new emitter for a file handle.
- Parameters
-
file | An open file for writing (may not be null). It is the caller's job to close the file when the emitter is destroyed. |
versionDirective | Include the YAML version directive at the start. |
HoverRace::Util::yaml::Emitter::Emitter |
( |
std::ostream & |
os, |
|
|
bool |
versionDirective = true |
|
) |
| |
Create a new emitter for an output stream.
- Parameters
-
os | The output stream. |
versionDirective | Include the YAML version directive at the start. |
HoverRace::Util::yaml::Emitter::Emitter |
( |
std::string & |
s, |
|
|
bool |
versionDirective = true |
|
) |
| |
Create a new emitter for a string.
- Parameters
-
s | The output string. |
versionDirective | Include the YAML version directive at the start. |
HoverRace::Util::yaml::Emitter::~Emitter |
( |
| ) |
|
|
virtual |
void HoverRace::Util::yaml::Emitter::EndMap |
( |
| ) |
|
void HoverRace::Util::yaml::Emitter::EndSeq |
( |
| ) |
|
End the current sequence.
void HoverRace::Util::yaml::Emitter::InitEmitter |
( |
| ) |
|
|
protected |
Initialize the LibYAML emitter.
This should only be called from the constructor.
void HoverRace::Util::yaml::Emitter::InitStream |
( |
bool |
versionDirective | ) |
|
|
protected |
Initialize the stream and document.
This should only be called from the constructor.
- Parameters
-
versionDirective | Include the YAML version directive at the start. |
void HoverRace::Util::yaml::Emitter::MapKey |
( |
const std::string & |
s | ) |
|
Write the key of a map.
- Parameters
-
s | The key name (may not be empty). |
void HoverRace::Util::yaml::Emitter::StartMap |
( |
| ) |
|
Start a map.
Writing a map involves:
- First, call StartMap().
- For each key-value pair, first write the key with MapKey(), then write the value (e.g. Value(), another map, a sequence, etc.)
- Finally, call EndMap() to close the map.
void HoverRace::Util::yaml::Emitter::StartSeq |
( |
| ) |
|
Start a sequence.
Writing a sequence involves:
- First, call StartSeq().
- For each element: call Value() for a single scalar value, or add a map or a sub-sequence.
- Finally, call EndSeq() to close the sequence.
void HoverRace::Util::yaml::Emitter::Value |
( |
const std::string & |
val | ) |
|
Write a single string value.
- Parameters
-
void HoverRace::Util::yaml::Emitter::Value |
( |
const char * |
val | ) |
|
Write a single string value.
- Parameters
-
val | The value (may not be nullptr ). |
void HoverRace::Util::yaml::Emitter::Value |
( |
bool |
val | ) |
|
Write a single boolean value.
- Parameters
-
void HoverRace::Util::yaml::Emitter::Value |
( |
int |
val | ) |
|
Write a single integer value.
- Parameters
-
void HoverRace::Util::yaml::Emitter::Value |
( |
double |
val | ) |
|
Write a single floating-point value.
- Parameters
-
void HoverRace::Util::yaml::Emitter::Value |
( |
float |
val | ) |
|
Write a single floating-point value.
- Parameters
-
Write a single path value.
- Parameters
-
template<class T >
void HoverRace::Util::yaml::Emitter::Value |
( |
const T & |
val | ) |
|
|
inline |
yaml_emitter_t HoverRace::Util::yaml::Emitter::emitter |
|
private |
The documentation for this class was generated from the following files: