Awali
Another Weighted Automata library
Namespaces | Data Structures | Typedefs | Enumerations | Functions
awali::json Namespace Reference

Namespaces

 internal
 

Data Structures

class  array_t
 
class  bool_t
 
class  coercion_exception
 Exception used when trying to coerce a node to a given type. More...
 
class  exception
 
class  float_t
 
class  heighter_t
 
class  inline_sizer_t
 
class  int_t
 
class  kind_mismatch
 
class  node_t
 
class  null_t
 
class  object_t
 
class  out_of_range
 
class  parse_exception
 
class  parser_t
 
class  smart_printer_t
 
class  string_t
 
class  uint_or_string_t
 
class  visitor_t
 Abstract class that helps implement a visitor of json tree or subtree. More...
 

Typedefs

typedef std::vector< uint_or_string_tpath_t
 

Enumerations

enum  node_kind_t {
  OBJECT = 0 , ARRAY = 1 , INTEGER = 2 , FLOATING = 3 ,
  STRING = 4 , BOOLEAN = 5 , _NULL = 6
}
 
enum class  visit_t { IGNORE_UNVISITED = -1 , CONTINUE = 0 , IGNORE_UNVISITED_CHILDREN = 1 , IGNORE_UNVISITED_CHILDREN_AND_SIBLINGS = 2 }
 

Functions

path_tdiff (json_ast_t left, json_ast_t right, bool ignore_metadata=true)
 Return the path where occurs the smallest difference between left and right, or nullptr if the two trees are equal. More...
 
bool equal (json_ast_t left, json_ast_t right, bool ignore_metadata=true)
 
std::string const & escape (char c)
 
std::string escape (std::string const &str)
 
std::ostream & escape_and_print (std::ostream &o, std::string const &str)
 
std::ostream & operator<< (std::ostream &o, node_kind_t kind)
 
node_tparse (std::istream &, bool stop_after_metadata=false)
 
std::ostream & put (std::ostream &out, node_t const *node)
 
std::ostream & put_inline (std::ostream &out, node_t const *node)
 
std::string const & string_of (node_kind_t kind)
 
std::string unescape (std::string const &str)
 

Typedef Documentation

◆ path_t

typedef std::vector<uint_or_string_t> awali::json::path_t

Enumeration Type Documentation

◆ node_kind_t

Enumerator
OBJECT 
ARRAY 
INTEGER 
FLOATING 
STRING 
BOOLEAN 
_NULL 

◆ visit_t

enum awali::json::visit_t
strong
Enumerator
IGNORE_UNVISITED 
CONTINUE 
IGNORE_UNVISITED_CHILDREN 
IGNORE_UNVISITED_CHILDREN_AND_SIBLINGS 

Function Documentation

◆ diff()

path_t* awali::json::diff ( json_ast_t  left,
json_ast_t  right,
bool  ignore_metadata = true 
)

Return the path where occurs the smallest difference between left and right, or nullptr if the two trees are equal.

◆ equal()

bool awali::json::equal ( json_ast_t  left,
json_ast_t  right,
bool  ignore_metadata = true 
)

◆ escape() [1/2]

std::string const& awali::json::escape ( char  c)

◆ escape() [2/2]

std::string awali::json::escape ( std::string const &  str)

◆ escape_and_print()

std::ostream& awali::json::escape_and_print ( std::ostream &  o,
std::string const &  str 
)

◆ operator<<()

std::ostream& awali::json::operator<< ( std::ostream &  o,
node_kind_t  kind 
)

◆ parse()

node_t* awali::json::parse ( std::istream &  ,
bool  stop_after_metadata = false 
)

◆ put()

std::ostream& awali::json::put ( std::ostream &  out,
node_t const *  node 
)

◆ put_inline()

std::ostream& awali::json::put_inline ( std::ostream &  out,
node_t const *  node 
)

◆ string_of()

std::string const& awali::json::string_of ( node_kind_t  kind)

◆ unescape()

std::string awali::json::unescape ( std::string const &  str)