FreeLing  4.0
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
freeling::config_file Class Reference

Class to handle loading a config file for freeling module, with XML-like sections. More...

#include <configfile.h>

Collaboration diagram for freeling::config_file:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 config_file (bool skip=false, const std::wstring &comment=L"##")
 Class to handle loading a config file for freeling module, with XML-like sections.
 ~config_file ()
void add_section (const std::wstring &key, int section, bool required=false)
bool open (const std::wstring &fname)
void close ()
bool get_content_line (std::wstring &line)
int get_section () const
int get_line_num () const
bool at_section_start () const

Private Member Functions

bool isopensection (const std::wstring &s) const
bool isclosesection (const std::wstring &s) const
bool iscomment (const std::wstring &s) const

Private Attributes

std::map< std::wstring, intsectionsopen
std::map< std::wstring, intsectionsclose
std::set< std::wstring > requiredsections
std::wifstream filestr
int section
std::wstring filename
bool section_start
std::wstring comment_prefix
int line_num
bool skip_unknown_sections
std::wstring unk_name

Static Private Attributes

static const int SECTION_NONE = -1
static const int SECTION_UNKNOWN = -2

Detailed Description

Class to handle loading a config file for freeling module, with XML-like sections.


Constructor & Destructor Documentation

freeling::config_file::config_file ( bool  skip = false,
const std::wstring &  comment = L"##" 
)

Class to handle loading a config file for freeling module, with XML-like sections.

----------------------------------------- Constructor

----------------------------------------- Destructor


Member Function Documentation

void freeling::config_file::add_section ( const std::wstring &  key,
int  section,
bool  required = false 
)

---------------------------------------- get whether current line is first in its section

References section_start.

Referenced by freeling::phonetics::phonetics().

bool freeling::config_file::get_content_line ( std::wstring &  line)

---------------------------------------- get current line number

References line_num.

bool freeling::config_file::isclosesection ( const std::wstring &  s) const [private]

----------------------------------------- See if a line is a section closing

Referenced by get_content_line().

bool freeling::config_file::iscomment ( const std::wstring &  s) const [private]

----------------------------------------- See if a line is a comment or an empty/blank line

References comment_prefix.

Referenced by get_content_line().

bool freeling::config_file::isopensection ( const std::wstring &  s) const [private]

----------------------------------------- See if a line is a section opening

Referenced by get_content_line().

bool freeling::config_file::open ( const std::wstring &  fname)

Member Data Documentation

std::wstring freeling::config_file::comment_prefix [private]

Referenced by iscomment().

std::wstring freeling::config_file::filename [private]

Referenced by get_content_line(), and open().

std::wifstream freeling::config_file::filestr [private]

Referenced by close(), get_content_line(), and open().

std::set<std::wstring> freeling::config_file::requiredsections [private]

Referenced by add_section(), and get_content_line().

Referenced by get_content_line(), get_section(), and open().

const int freeling::config_file::SECTION_NONE = -1 [static, private]

Referenced by get_content_line(), and open().

const int freeling::config_file::SECTION_UNKNOWN = -2 [static, private]

Referenced by get_content_line().

std::map<std::wstring,int> freeling::config_file::sectionsclose [private]

Referenced by add_section(), and get_content_line().

std::map<std::wstring,int> freeling::config_file::sectionsopen [private]

Referenced by add_section(), and get_content_line().

Referenced by get_content_line().

std::wstring freeling::config_file::unk_name [private]

Referenced by get_content_line().


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