![]() |
![]() |
|
Index
Source Files
Annotated Class List
Alphabetical Class List
Class Hierarchy
Graphical Class Hierarchy
|
||
![]() |
![]() |
#include <Settings.h>
Public Types | |
| typedef std::vector< Dictionary > | Sections |
Public Member Functions | |
| Sections | get (std::string name) const |
Private Attributes | |
| Sections | m_sections |
Friends | |
| std::istream & | operator>> (std::istream &, Settings &) |
Definition at line 38 of file Settings.h.
|
|
Definition at line 41 of file Settings.h. Referenced by get(), and FIX::operator>>(). |
|
|
Definition at line 62 of file Settings.cpp. References m_sections, QF_STACK_POP, QF_STACK_PUSH, and Sections. Referenced by FIX::operator>>().
00063 { QF_STACK_PUSH(Settings::get)
00064
00065 Sections sections;
00066 for ( Sections::size_type i = 0; i < m_sections.size(); ++i )
00067 if ( m_sections[ i ].getName() == name )
00068 sections.push_back( m_sections[ i ] );
00069 return sections;
00070
00071 QF_STACK_POP
00072 }
|
|
||||||||||||
|
Definition at line 32 of file Settings.cpp.
00033 {
00034 ConfigLexer lexer( &stream );
00035 int lcState = 0;
00036 Settings::Sections::iterator currentSection = s.m_sections.end();
00037 std::string currentName;
00038 while ( 0 != ( lcState = lexer.yylex() ) )
00039 {
00040 switch ( lcState )
00041 {
00042 case ConfigLexer::LC_STATE_SECTION:
00043 currentSection = s.m_sections.insert
00044 ( s.m_sections.end(),
00045 Dictionary( lexer.YYText() ) );
00046 break;
00047 case ConfigLexer::LC_STATE_NAME:
00048 currentName = lexer.YYText();
00049 break;
00050 case ConfigLexer::LC_STATE_VALUE:
00051 std::string value = lexer.YYText();
00052 std::string::size_type pos = value.find_last_not_of( ' ' );
00053 if ( pos == std::string::npos ) continue;
00054 value.resize( pos + 1 );
00055 ( *currentSection ).setString( currentName, value );
00056 break;
00057 }
00058 }
00059 return stream;
00060 }
|
|
|
Definition at line 47 of file Settings.h. Referenced by get(), and FIX::operator>>(). |
1.3.6-20040222 written by Dimitri van Heesch,
© 1997-2001