InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ConfigTag Class Reference

#include <configreader.h>

Inheritance diagram for ConfigTag:
refcountbase

Public Member Functions

std::string getString (const std::string &key, const std::string &def="")
 
long getInt (const std::string &key, long def=0)
 
double getFloat (const std::string &key, double def=0)
 
bool getBool (const std::string &key, bool def=false)
 
bool readString (const std::string &key, std::string &value, bool allow_newline=false)
 
std::string getTagLocation ()
 
const std::vector< KeyVal > & getItems () const
 
- Public Member Functions inherited from refcountbase
unsigned int GetReferenceCount () const
 
void refcount_inc () const
 
bool refcount_dec () const
 

Static Public Member Functions

static ConfigTagcreate (const std::string &Tag, const std::string &file, int line, std::vector< KeyVal > *&Items)
 
- Static Public Member Functions inherited from refcountbase
static void * operator new (size_t, void *m)
 
static void * operator new (size_t)
 
static void operator delete (void *)
 

Public Attributes

const std::string tag
 
const std::string src_name
 
const int src_line
 

Detailed Description

Structure representing a single <tag> in config

Member Function Documentation

ConfigTag * ConfigTag::create ( const std::string &  Tag,
const std::string &  file,
int  line,
std::vector< KeyVal > *&  Items 
)
static

Create a new ConfigTag, giving access to the private KeyVal item list

bool ConfigTag::getBool ( const std::string &  key,
bool  def = false 
)

Get the value of an option, using def if it does not exist

double ConfigTag::getFloat ( const std::string &  key,
double  def = 0 
)

Get the value of an option, using def if it does not exist

long ConfigTag::getInt ( const std::string &  key,
long  def = 0 
)

Get the value of an option, using def if it does not exist

std::string ConfigTag::getString ( const std::string &  key,
const std::string &  def = "" 
)

Get the value of an option, using def if it does not exist

bool ConfigTag::readString ( const std::string &  key,
std::string &  value,
bool  allow_newline = false 
)

Get the value of an option

Parameters
keyThe option to get
valueThe location to store the value (unmodified if does not exist)
allow_newlineAllow newlines in the option (normally replaced with spaces)
Returns
true if the option exists

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