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 40 of file code_generators.h.

Constructor & Destructor Documentation

◆ CodeWriter()

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

Definition at line 42 of file code_generators.h.

43 : pad_(pad), cur_ident_lvl_(0), ignore_ident_(false) {}

Member Function Documentation

◆ Clear()

void flatbuffers::CodeWriter::Clear ( )
inline

Definition at line 46 of file code_generators.h.

46 {
47 stream_.str("");
48 stream_.clear();
49 }

◆ DecrementIdentLevel()

void flatbuffers::CodeWriter::DecrementIdentLevel ( )
inline

Definition at line 75 of file code_generators.h.

75 {
76 if (cur_ident_lvl_) cur_ident_lvl_--;
77 }

◆ GetValue()

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

Definition at line 58 of file code_generators.h.

58 {
59 const auto it = value_map_.find(key);
60 return it == value_map_.end() ? "" : it->second;
61 }

◆ IncrementIdentLevel()

void flatbuffers::CodeWriter::IncrementIdentLevel ( )
inline

Definition at line 73 of file code_generators.h.

73{ cur_ident_lvl_++; }

◆ operator+=()

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

◆ SetPadding()

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

Definition at line 79 of file code_generators.h.

79{ pad_ = padding; }

◆ SetValue()

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

Definition at line 54 of file code_generators.h.

54 {
55 value_map_[key] = value;
56 }

◆ ToString()

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

Definition at line 70 of file code_generators.h.

70{ return stream_.str(); }

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