FIX::Settings Class Reference

Internal representation of QuickFIX configuration settings. More...

`#include <Settings.h>`

## Public Types

typedef std::vector< Dictionary > | Sections

## Public Member Functions

| Settings (bool resolveEnvVars=false)
Sections | get (const std::string &name) const

## Private Attributes

Sections | m_sections
bool | m_resolveEnvVars

## Friends

std::istream & | operator>> (std::istream &, Settings &)

## Detailed Description

Internal representation of QuickFIX configuration settings.

Definition at line 38 of file Settings.h.

## Member Typedef Documentation

## Sections

typedef std::vector< Dictionary > FIX::Settings::Sections

Definition at line 43 of file Settings.h.

## Constructor & Destructor Documentation

## Settings()

FIX::Settings::Settings | ( | bool | resolveEnvVars = `false` | ) |

inline

Definition at line 41 of file Settings.h.

: m_resolveEnvVars(resolveEnvVars) {}
FIX::Settings::m_resolveEnvVars
bool m_resolveEnvVars
Definition: Settings.h:50
FIX::resolveEnvVars
std::string resolveEnvVars(const std::string &str)
Definition: Settings.cpp:65

## Member Function Documentation

## get()

Settings::Sections FIX::Settings::get | ( | const std::string & | name | ) | const

Definition at line 162 of file Settings.cpp.

{
Sections sections;
for ( Sections::size_type i = 0; i < m_sections.size(); ++i )
if ( m_sections[ i ].getName() == name )
sections.push_back( m_sections[ i ] );
return sections;
}
FIX::Settings::Sections
std::vector< Dictionary > Sections
Definition: Settings.h:43
FIX::Settings::m_sections
Sections m_sections
Definition: Settings.h:49

References m_sections.

## Friends And Related Function Documentation

## operator>>

std::istream& operator>> | ( | std::istream & | ,
|  | Settings & |
| ) |  |

friend

Definition at line 134 of file Settings.cpp.

{
char buffer[1024];
std::string line;
Settings::Sections::iterator section = s.m_sections.end();;
while( stream.getline(buffer, sizeof(buffer)) )
{
line = string_strip( buffer );
if( isComment(line) )
{
continue;
}
else if( isSection(line) )
{
section = s.m_sections.insert( s.m_sections.end(), Dictionary(splitSection(line)) );
}
else if( isKeyValue(line) )
{
std::pair<std::string, std::string> keyValue = splitKeyValue( line );
if( section == s.m_sections.end() )
continue;
(*section).setString( keyValue.first, s.m_resolveEnvVars ? resolveEnvVars(keyValue.second) : keyValue.second );
}
}
return stream;
}
FIX::string_strip
std::string string_strip(const std::string &value)
Definition: Utility.cpp:67
FIX::isComment
bool isComment(const std::string &line)
Definition: Settings.cpp:31
FIX::splitSection
std::string splitSection(const std::string &line)
Definition: Settings.cpp:47
FIX::isKeyValue
bool isKeyValue(const std::string &line)
Definition: Settings.cpp:52
FIX::splitKeyValue
std::pair< std::string, std::string > splitKeyValue(const std::string &line)
Definition: Settings.cpp:57
FIX::isSection
bool isSection(const std::string &line)
Definition: Settings.cpp:39

## Member Data Documentation

## m_resolveEnvVars

bool FIX::Settings::m_resolveEnvVars

private

Definition at line 50 of file Settings.h.

## m_sections

Sections FIX::Settings::m_sections

private

Definition at line 49 of file Settings.h.

Referenced by get().

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

- Settings.h
- Settings.cpp