Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
serialize.h File Reference
#include <sstream>
#include <string>
#include <utility>
#include "ion/base/stringutils.h"
Include dependency graph for serialize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::base
 EnumHelper instantiations. These must be in the ion::base namespace.
 

Functions

template<typename T >
bool ion::base::StringToValue (std::istringstream &in, T *val)
 This file defines two public functions: StringToValue() and ValueToString(). More...
 
template<>
bool ion::base::StringToValue (std::istringstream &in, bool *val)
 Specialize for bools. More...
 
template<typename T , typename U , typename V >
bool ion::base::StringToValue (std::istringstream &in, std::basic_string< T, U, V > *val)
 Overload for reading double quoted strings. More...
 
template<typename T , typename U >
bool ion::base::StringToValue (std::istringstream &in, std::pair< const T, U > *val)
 Overload for std::pair types. More...
 
template<typename ContainerType >
bool ion::base::StringToStlContainer (std::istringstream &in, ContainerType *val)
 Constructs a STL container from a stream. More...
 
template<typename T , typename U , typename V , typename W , typename X , bool B, template< class, class, class, class, class, bool > class ContainerType>
bool ion::base::StringToValue (std::istringstream &in, ContainerType< T, U, V, W, X, B > *val)
 Overload for std::unordered_map with a bool at the end. More...
 
template<typename T , typename U , typename V , typename W , typename X , template< class, class, class, class, class > class ContainerType>
bool ion::base::StringToValue (std::istringstream &in, ContainerType< T, U, V, W, X > *val)
 Overload for std::unordered_map without a bool at the end. More...
 
template<typename T , typename U , typename V , typename W , bool B, template< class, class, class, class, bool > class ContainerType>
bool ion::base::StringToValue (std::istringstream &in, ContainerType< T, U, V, W, B > *val)
 Overload for std::unordered_set with a bool at the end. More...
 
template<typename T , typename U , typename V , typename W , template< class, class, class, class > class ContainerType>
bool ion::base::StringToValue (std::istringstream &in, ContainerType< T, U, V, W > *val)
 Overload for std::map and std::unordered_set without a bool at the end. More...
 
template<typename T , typename U , typename V , template< class, class, class > class ContainerType>
bool ion::base::StringToValue (std::istringstream &in, ContainerType< T, U, V > *val)
 Overload for std::set. More...
 
template<typename T , typename U , template< class, class > class ContainerType>
bool ion::base::StringToValue (std::istringstream &in, ContainerType< T, U > *val)
 Overload for STL containers like deque, list, vector. More...
 
template<typename T >
bool ion::base::StringToValue (const std::string &s, T *val)
 Convenience function that converts a std::string to a T, constructing the istringstream automatically. More...
 
template<typename T >
std::string ion::base::ValueToString (const T &val)
 ValueToString. More...
 
template<>
std::string ion::base::ValueToString (const bool &val)
 Specialize for bools. More...
 
template<>
std::string ion::base::ValueToString (const float &val)
 Specialize for printing significant digits of floating point numbers. More...
 
template<>
std::string ion::base::ValueToString (const double &val)
 
template<typename T , typename U , typename V >
std::string ion::base::ValueToString (const std::basic_string< T, U, V > &val)
 Overload for writing double quoted strings. More...
 
template<>
std::string ion::base::ValueToString (const char *const &val)
 Overload for writing double quoted C-strings. More...
 
template<typename T , typename U >
std::string ion::base::ValueToString (const std::pair< const T, U > &val)
 Overload for std::pair types. More...
 
template<typename ContainerType >
std::string ion::base::StlContainerToString (const ContainerType &c)
 Serializes an STL container to a string. More...
 
template<typename T , typename U , typename V , typename W , typename X , bool B, template< class, class, class, class, class, bool > class ContainerType>
std::string ion::base::ValueToString (const ContainerType< T, U, V, W, X, B > &val)
 Overload for std::unordered_map with a bool at the end. More...
 
template<typename T , typename U , typename V , typename W , typename X , template< class, class, class, class, class > class ContainerType>
std::string ion::base::ValueToString (const ContainerType< T, U, V, W, X > &val)
 Overload for std::unordered_map without a bool at the end. More...
 
template<typename T , typename U , typename V , typename W , bool B, template< class, class, class, class, bool > class ContainerType>
std::string ion::base::ValueToString (const ContainerType< T, U, V, W, B > &val)
 Overload for std::unordered_set with a bool at the end. More...
 
template<typename T , typename U , typename V , typename W , template< class, class, class, class > class ContainerType>
std::string ion::base::ValueToString (const ContainerType< T, U, V, W > &val)
 Overload for std::map and std::unordered_set without a bool at the end. More...
 
template<typename T , typename U , typename V , template< class, class, class > class ContainerType>
std::string ion::base::ValueToString (const ContainerType< T, U, V > &val)
 Overload for std::set. More...
 
template<typename T , typename U , template< class, class > class ContainerType>
std::string ion::base::ValueToString (const ContainerType< T, U > &val)
 Overload for non-associative STL containers (deque, list, vector). More...