ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flatbuffers::CodeWriter Class Reference

#include <code_generators.h>

Public Member Functions

 CodeWriter (std::string pad=std::string())
 
void Clear ()
 
void SetValue (const std::string &key, const std::string &value)
 
std::string GetValue (const std::string &key) const
 
void operator+= (std::string text)
 
std::string ToString () const
 
void IncrementIdentLevel ()
 
void DecrementIdentLevel ()
 
void SetPadding (const std::string &padding)
 

Detailed Description

Definition at line 42 of file code_generators.h.

Constructor & Destructor Documentation

◆ CodeWriter()

flatbuffers::CodeWriter::CodeWriter ( std::string  pad = std::string())
inline

Definition at line 45 of file code_generators.h.

45 : pad_(pad), cur_ident_lvl_(0), ignore_ident_(false)
46 {
47 }

Member Function Documentation

◆ Clear()

void flatbuffers::CodeWriter::Clear ( )
inline

Definition at line 50 of file code_generators.h.

51 {
52 stream_.str("");
53 stream_.clear();
54 }

◆ DecrementIdentLevel()

void flatbuffers::CodeWriter::DecrementIdentLevel ( )
inline

Definition at line 79 of file code_generators.h.

80 {
81 if (cur_ident_lvl_)
82 cur_ident_lvl_--;
83 }

◆ GetValue()

std::string flatbuffers::CodeWriter::GetValue ( const std::string &  key) const
inline

Definition at line 61 of file code_generators.h.

62 {
63 const auto it = value_map_.find(key);
64 return it == value_map_.end() ? "" : it->second;
65 }

◆ IncrementIdentLevel()

void flatbuffers::CodeWriter::IncrementIdentLevel ( )
inline

Definition at line 77 of file code_generators.h.

77{ cur_ident_lvl_++; }

◆ operator+=()

void flatbuffers::CodeWriter::operator+= ( std::string  text)

◆ SetPadding()

void flatbuffers::CodeWriter::SetPadding ( const std::string &  padding)
inline

Definition at line 85 of file code_generators.h.

85{ pad_ = padding; }

◆ SetValue()

void flatbuffers::CodeWriter::SetValue ( const std::string &  key,
const std::string &  value 
)
inline

Definition at line 59 of file code_generators.h.

59{ value_map_[key] = value; }

◆ ToString()

std::string flatbuffers::CodeWriter::ToString ( ) const
inline

Definition at line 74 of file code_generators.h.

74{ return stream_.str(); }

The documentation for this class was generated from the following file: