CEBL  2.1
Public Member Functions | Friends
Session Class Reference

#include <Session.hpp>

Public Member Functions

 Session ()
 ~Session ()
 Session (const Session &)
void load (const char *filename)
 Load session from session file.
void save (const char *filename)
 Save session to session file.
void save ()
 Save session to current session file.
bool shouldSaveAs ()
 Should the user be prompted to save as.
template<typename T >
void add (std::string param, const T &value, std::string section="")
 Add any type param to the session.
template<typename T >
void add (const char *param, const T &value, std::string section="")
 Add any type param to the session.
template<typename T >
Sessionoperator() (std::string param, const T &value)
 easy access to add
template<typename T >
Sessionoperator() (const char *param, const T &value)
 easy access to add
void clear ()
 Clear contents.
void setCurrentSection (std::string sc)
 Set current section so it doesn't have to be specified every time.
bool exists (std::string param, std::string section="")
 Check if a value exists.
template<typename T >
get (std::string param, std::string section="")
 get parameter
template<typename T >
void get (std::string param, T *v, std::string section="")
 get into given variable

Friends

std::ostream & operator<< (std::ostream &os, Session &s1)
 Send to ostream.

Detailed Description

Definition at line 39 of file Session.hpp.


Constructor & Destructor Documentation

Session::Session ( )

Definition at line 25 of file Session.cpp.

Session::~Session ( )

Definition at line 32 of file Session.cpp.

Session::Session ( const Session s2)

Definition at line 36 of file Session.cpp.


Member Function Documentation

template<typename T >
void Session::add ( std::string  param,
const T &  value,
std::string  section = "" 
)
inline

Add any type param to the session.

Definition at line 72 of file Session.hpp.

template<typename T >
void Session::add ( const char *  param,
const T &  value,
std::string  section = "" 
)
inline

Add any type param to the session.

Definition at line 84 of file Session.hpp.

void Session::clear ( )
inline

Clear contents.

Definition at line 106 of file Session.hpp.

bool Session::exists ( std::string  param,
std::string  section = "" 
)

Check if a value exists.

Definition at line 158 of file Session.cpp.

References cppR::count().

template<typename T >
T Session::get ( std::string  param,
std::string  section = "" 
)
inline

get parameter

Definition at line 121 of file Session.hpp.

template<typename T >
void Session::get ( std::string  param,
T *  v,
std::string  section = "" 
)
inline

get into given variable

Definition at line 136 of file Session.hpp.

void Session::load ( const char *  filename)

Load session from session file.

Definition at line 49 of file Session.cpp.

Referenced by SessionManager::load().

template<typename T >
Session& Session::operator() ( std::string  param,
const T &  value 
)
inline

easy access to add

Definition at line 91 of file Session.hpp.

template<typename T >
Session& Session::operator() ( const char *  param,
const T &  value 
)
inline

easy access to add

Definition at line 99 of file Session.hpp.

void Session::save ( const char *  filename)

Save session to session file.

Definition at line 118 of file Session.cpp.

Referenced by SessionManager::save(), and SessionManager::saveAs().

void Session::save ( )

Save session to current session file.

Save to file already saved to once before.

Definition at line 137 of file Session.cpp.

References boost::serialization::save().

void Session::setCurrentSection ( std::string  sc)
inline

Set current section so it doesn't have to be specified every time.

Definition at line 114 of file Session.hpp.

bool Session::shouldSaveAs ( )

Should the user be prompted to save as.

Should the user specify where to save?

Definition at line 143 of file Session.cpp.

Referenced by SessionManager::shouldSaveAs().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
Session s1 
)
friend

Send to ostream.

Definition at line 149 of file Session.cpp.


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