zep
Classes | Typedefs | Functions
cpptoml.h File Reference
#include <algorithm>
#include <cassert>
#include <clocale>
#include <cstdint>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <map>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>

Go to the source code of this file.

Classes

class  cpptoml::option< T >
 
struct  cpptoml::local_date
 
struct  cpptoml::local_time
 
struct  cpptoml::zone_offset
 
struct  cpptoml::local_datetime
 
struct  cpptoml::offset_datetime
 
class  cpptoml::fill_guard
 
struct  cpptoml::is_one_of< T, Ts >
 
struct  cpptoml::is_one_of< T, V >
 
struct  cpptoml::is_one_of< T, V, Ts... >
 
class  cpptoml::value< T >
 A concrete TOML value representing the "leaves" of the "tree". More...
 
struct  cpptoml::valid_value< T >
 
struct  cpptoml::value_traits< T, Enable >
 
struct  cpptoml::valid_value_or_string_convertible< T >
 
struct  cpptoml::value_traits< T, typename std::enable_if< valid_value_or_string_convertible< T >::value >::type >
 
struct  cpptoml::value_traits< T, typename std::enable_if< !valid_value_or_string_convertible< T >::value &&std::is_floating_point< typename std::decay< T >::type >::value >::type >
 
struct  cpptoml::value_traits< T, typename std::enable_if< !valid_value_or_string_convertible< T >::value &&!std::is_floating_point< typename std::decay< T >::type >::value &&std::is_signed< typename std::decay< T >::type >::value >::type >
 
struct  cpptoml::value_traits< T, typename std::enable_if< !valid_value_or_string_convertible< T >::value &&std::is_unsigned< typename std::decay< T >::type >::value >::type >
 
struct  cpptoml::array_of_trait< T >
 
struct  cpptoml::array_of_trait< array >
 
class  cpptoml::base
 A generic base TOML value used for type erasure. More...
 
class  cpptoml::value< T >
 A concrete TOML value representing the "leaves" of the "tree". More...
 
class  cpptoml::array_exception
 Exception class for array insertion errors. More...
 
class  cpptoml::array
 
class  cpptoml::table_array
 
class  cpptoml::table
 Represents a TOML keytable. More...
 
class  cpptoml::parse_exception
 Exception class for all TOML parsing errors. More...
 
class  cpptoml::consumer< OnError >
 Helper object for consuming expected characters. More...
 
class  cpptoml::parser
 The parser class. More...
 
struct  cpptoml::value_accept< Ts >
 
struct  cpptoml::value_accept<>
 
struct  cpptoml::value_accept< T, Ts... >
 
class  cpptoml::toml_writer
 Writer that can be passed to accept() functions of cpptoml objects and will output valid TOML to a stream. More...
 

Typedefs

using cpptoml::string_to_base_map = std::unordered_map< std::string, std::shared_ptr< base >>
 
typedef offset_datetime cpptoml::datetime
 

Functions

std::ostream & cpptoml::operator<< (std::ostream &os, const local_date &dt)
 
std::ostream & cpptoml::operator<< (std::ostream &os, const local_time &ltime)
 
std::ostream & cpptoml::operator<< (std::ostream &os, const zone_offset &zo)
 
std::ostream & cpptoml::operator<< (std::ostream &os, const local_datetime &dt)
 
std::ostream & cpptoml::operator<< (std::ostream &os, const offset_datetime &dt)
 
template<class T >
std::shared_ptr< typename value_traits< T >::type > cpptoml::make_value (T &&val)
 
std::shared_ptr< array > cpptoml::make_array ()
 
template<class T >
std::shared_ptr< T > cpptoml::detail::make_element ()
 
std::shared_ptr< table > cpptoml::make_table ()
 
std::shared_ptr< table_array > cpptoml::make_table_array (bool is_inline=false)
 
template<>
std::shared_ptr< array > cpptoml::detail::make_element< array > ()
 
template<>
std::shared_ptr< table_array > cpptoml::detail::make_element< table_array > ()
 
template<class T >
std::enable_if<!std::is_floating_point< T >::value &&std::is_signed< T >::value, option< T > >::type cpptoml::get_impl (const std::shared_ptr< base > &elem)
 
template<class T >
std::enable_if<!std::is_same< T, bool >::value &&std::is_unsigned< T >::value, option< T > >::type cpptoml::get_impl (const std::shared_ptr< base > &elem)
 
template<class T >
std::enable_if<!std::is_integral< T >::value||std::is_same< T, bool >::value, option< T > >::type cpptoml::get_impl (const std::shared_ptr< base > &elem)
 
template<>
std::shared_ptr< table > cpptoml::detail::make_element< table > ()
 
bool cpptoml::is_number (char c)
 
bool cpptoml::is_hex (char c)
 
template<class OnError >
consumer< OnError > cpptoml::make_consumer (std::string::iterator &it, const std::string::iterator &end, OnError &&on_error)
 
std::istream & cpptoml::detail::getline (std::istream &input, std::string &line)
 
std::shared_ptr< table > cpptoml::parse_file (const std::string &filename)
 Utility function to parse a file as a TOML file. More...
 
std::ostream & cpptoml::operator<< (std::ostream &stream, const base &b)
 
template<class T >
std::ostream & cpptoml::operator<< (std::ostream &stream, const value< T > &v)
 
std::ostream & cpptoml::operator<< (std::ostream &stream, const table &t)
 
std::ostream & cpptoml::operator<< (std::ostream &stream, const table_array &t)
 
std::ostream & cpptoml::operator<< (std::ostream &stream, const array &a)
 

Detailed Description

Author
Chase Geigle
Date
May 2013

Function Documentation

§ parse_file()

std::shared_ptr<table> cpptoml::parse_file ( const std::string &  filename)
inline

Utility function to parse a file as a TOML file.

Returns the root table. Throws a parse_exception if the file cannot be opened.