Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
RSJresource Class Reference

#include <RSJparser.hpp>

Collaboration diagram for RSJresource:

Public Member Functions

 RSJresource ()
 
 RSJresource (std::string str)
 
 RSJresource (const char *str)
 
template<class dataType >
 RSJresource (dataType d)
 
 RSJresource (std::istream &is)
 
 RSJresource (std::ifstream &ifs)
 
 ~RSJresource ()
 
 RSJresource (const RSJresource &r)
 
RSJresourceoperator= (const RSJresource &r)
 
RSJresourceType parse (bool force=false)
 
void parse_full (bool force=false, int max_depth=INT_MAX, int *parse_count_for_verbose_p=NULL)
 
void fast_parse (std::string *str_p=NULL, bool copy_string=false, int max_depth=INT_MAX, size_t *parse_start_str_pos=NULL)
 
RSJobjectas_object (bool force=false)
 
RSJarrayas_array (bool force=false)
 
int size (void)
 
std::string & raw_data (void)
 
bool exists (void)
 
bool is_parsed (void)
 
RSJresourceType type (void)
 
std::string as_str (bool print_comments=false, bool update_data=true)
 
void print (bool print_comments=false, bool update_data=true)
 
RSJresourceoperator[] (std::string key)
 
RSJresourceoperator[] (unsigned int indx)
 
template<class dataType >
dataType as (const dataType &def=dataType())
 
template<class dataType , class vectorType = std::vector<dataType>>
vectorType as_vector (const vectorType &def=vectorType())
 
template<class dataType , class mapType = std::unordered_map<std::string,dataType>>
mapType as_map (const mapType &def=mapType())
 
template<>
RSJobject as (const RSJobject &def)
 
template<>
RSJarray as (const RSJarray &def)
 
template<>
int as (const int &def)
 
template<>
double as (const double &def)
 
template<>
bool as (const bool &def)
 

Private Attributes

std::string data
 
bool _exists
 
RSJparsedDataparsed_data_p
 

Constructor & Destructor Documentation

◆ RSJresource() [1/7]

RSJresource::RSJresource ( )
inline

◆ RSJresource() [2/7]

RSJresource::RSJresource ( std::string  str)
inline

◆ RSJresource() [3/7]

RSJresource::RSJresource ( const char *  str)
inline

◆ RSJresource() [4/7]

template<class dataType >
RSJresource::RSJresource ( dataType  d)
inline

◆ RSJresource() [5/7]

RSJresource::RSJresource ( std::istream &  is)
inline

◆ RSJresource() [6/7]

RSJresource::RSJresource ( std::ifstream &  ifs)
inline

◆ ~RSJresource()

RSJresource::~RSJresource ( )

◆ RSJresource() [7/7]

RSJresource::RSJresource ( const RSJresource r)

Member Function Documentation

◆ as() [1/6]

template<class dataType >
dataType RSJresource::as ( const dataType &  def = dataType())
inline

◆ as() [2/6]

template<>
RSJobject RSJresource::as ( const RSJobject def)
inline

◆ as() [3/6]

template<>
RSJarray RSJresource::as ( const RSJarray def)
inline

◆ as() [4/6]

template<>
int RSJresource::as ( const int &  def)
inline

◆ as() [5/6]

template<>
double RSJresource::as ( const double &  def)
inline

◆ as() [6/6]

template<>
bool RSJresource::as ( const bool &  def)
inline

◆ as_array()

RSJarray & RSJresource::as_array ( bool  force = false)

◆ as_map()

template<class dataType , class mapType >
mapType RSJresource::as_map ( const mapType &  def = mapType())

◆ as_object()

RSJobject & RSJresource::as_object ( bool  force = false)

◆ as_str()

std::string RSJresource::as_str ( bool  print_comments = false,
bool  update_data = true 
)

◆ as_vector()

template<class dataType , class vectorType >
vectorType RSJresource::as_vector ( const vectorType &  def = vectorType())

◆ exists()

bool RSJresource::exists ( void  )
inline

◆ fast_parse()

void RSJresource::fast_parse ( std::string *  str_p = NULL,
bool  copy_string = false,
int  max_depth = INT_MAX,
size_t *  parse_start_str_pos = NULL 
)

◆ is_parsed()

bool RSJresource::is_parsed ( void  )
inline

◆ operator=()

RSJresource & RSJresource::operator= ( const RSJresource r)

◆ operator[]() [1/2]

RSJresource & RSJresource::operator[] ( std::string  key)

◆ operator[]() [2/2]

RSJresource & RSJresource::operator[] ( unsigned int  indx)

◆ parse()

RSJresourceType RSJresource::parse ( bool  force = false)

◆ parse_full()

void RSJresource::parse_full ( bool  force = false,
int  max_depth = INT_MAX,
int *  parse_count_for_verbose_p = NULL 
)

◆ print()

void RSJresource::print ( bool  print_comments = false,
bool  update_data = true 
)
inline

◆ raw_data()

std::string& RSJresource::raw_data ( void  )
inline

◆ size()

int RSJresource::size ( void  )

◆ type()

RSJresourceType RSJresource::type ( void  )

Member Data Documentation

◆ _exists

bool RSJresource::_exists
private

◆ data

std::string RSJresource::data
private

◆ parsed_data_p

RSJparsedData* RSJresource::parsed_data_p
private