Public Types | Public Member Functions | Private Attributes | Friends | List of all members
FIX::Settings Class Reference

Internal representation of QuickFIX configuration settings. More...

#include <Settings.h>

Public Types

typedef std::vector< DictionarySections
 

Public Member Functions

Sections get (const std::string &name) const
 

Private Attributes

Sections m_sections
 

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

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

Definition at line 41 of file Settings.h.

Member Function Documentation

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

Definition at line 92 of file Settings.cpp.

References m_sections.

Referenced by FIX::operator>>().

93 {
94  Sections sections;
95  for ( Sections::size_type i = 0; i < m_sections.size(); ++i )
96  if ( m_sections[ i ].getName() == name )
97  sections.push_back( m_sections[ i ] );
98  return sections;
99 }
Sections m_sections
Definition: Settings.h:47
std::vector< Dictionary > Sections
Definition: Settings.h:41

Friends And Related Function Documentation

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

Definition at line 64 of file Settings.cpp.

65 {
66  char buffer[1024];
67  std::string line;
68  Settings::Sections::iterator section = s.m_sections.end();;
69 
70  while( stream.getline(buffer, 1024) )
71  {
72  line = string_strip( buffer );
73  if( isComment(line) )
74  {
75  continue;
76  }
77  else if( isSection(line) )
78  {
79  section = s.m_sections.insert( s.m_sections.end(), Dictionary(splitSection(line)) );
80  }
81  else if( isKeyValue(line) )
82  {
83  std::pair<std::string, std::string> keyValue = splitKeyValue( line );
84  if( section == s.m_sections.end() )
85  continue;
86  (*section).setString( keyValue.first, keyValue.second );
87  }
88  }
89  return stream;
90 }
bool isSection(const std::string &line)
Definition: Settings.cpp:38
bool isComment(const std::string &line)
Definition: Settings.cpp:30
std::pair< std::string, std::string > splitKeyValue(const std::string &line)
Definition: Settings.cpp:56
std::string splitSection(const std::string &line)
Definition: Settings.cpp:46
std::string string_strip(const std::string &value)
Definition: Utility.cpp:67
bool isKeyValue(const std::string &line)
Definition: Settings.cpp:51

Member Data Documentation

Sections FIX::Settings::m_sections
private

Definition at line 47 of file Settings.h.

Referenced by get(), and FIX::operator>>().


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

Generated on Sat Mar 29 2014 15:13:35 for QuickFIX by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2001