fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::push_dir Class Reference

#include <f8c.hpp>

Public Member Functions

 push_dir (const std::string &to)
 
 push_dir (const char *to)
 
 push_dir ()
 
 ~push_dir ()
 

Private Member Functions

void getdir ()
 
void chgdir (const char *to) const
 

Private Attributes

char _cwd [FIX8_MAX_FLD_LENGTH]
 

Detailed Description

Definition at line 207 of file f8c.hpp.

Constructor & Destructor Documentation

FIX8::push_dir::push_dir ( const std::string &  to)
inlineexplicit

Definition at line 242 of file f8c.hpp.

References chgdir(), and getdir().

242 : _cwd() { getdir(); chgdir(to.c_str()); }
void getdir()
Definition: f8c.hpp:211
char _cwd[FIX8_MAX_FLD_LENGTH]
Definition: f8c.hpp:209
void chgdir(const char *to) const
Definition: f8c.hpp:225
FIX8::push_dir::push_dir ( const char *  to)
inlineexplicit

Definition at line 243 of file f8c.hpp.

References chgdir(), and getdir().

243 : _cwd() { getdir(); chgdir(to); }
void getdir()
Definition: f8c.hpp:211
char _cwd[FIX8_MAX_FLD_LENGTH]
Definition: f8c.hpp:209
void chgdir(const char *to) const
Definition: f8c.hpp:225
FIX8::push_dir::push_dir ( )
inline

Definition at line 244 of file f8c.hpp.

References getdir().

244 : _cwd() { getdir(); }
void getdir()
Definition: f8c.hpp:211
char _cwd[FIX8_MAX_FLD_LENGTH]
Definition: f8c.hpp:209
FIX8::push_dir::~push_dir ( )
inline

Definition at line 245 of file f8c.hpp.

References chgdir().

245 { chgdir(_cwd); }
char _cwd[FIX8_MAX_FLD_LENGTH]
Definition: f8c.hpp:209
void chgdir(const char *to) const
Definition: f8c.hpp:225

Member Function Documentation

void FIX8::push_dir::chgdir ( const char *  to) const
inlineprivate

Definition at line 225 of file f8c.hpp.

Referenced by push_dir(), and ~push_dir().

226  {
227 #ifdef _MSC_VER
228  if (!to || _chdir(to))
229 #else
230  if (!to || ::chdir(to))
231 #endif
232  {
233  std::ostringstream ostr;
234  ostr << "Error changing to directory '" << (to ? to : "(null)") << '\'';
235  if (errno)
236  ostr << " (" << ::strerror(errno) << ')';
237  throw f8Exception(ostr.str());
238  }
239  }
void FIX8::push_dir::getdir ( )
inlineprivate

Definition at line 211 of file f8c.hpp.

References FIX8_MAX_FLD_LENGTH.

Referenced by push_dir().

212  {
213 #ifdef _MSC_VER
214  if (_getcwd(_cwd, FIX8_MAX_FLD_LENGTH) == 0)
215 #else
216  if (::getcwd(_cwd, FIX8_MAX_FLD_LENGTH) == 0)
217 #endif
218  {
219  std::ostringstream ostr;
220  ostr << "Error getting current directory (" << ::strerror(errno) << ')';
221  throw f8Exception(ostr.str());
222  }
223  }
#define FIX8_MAX_FLD_LENGTH
Definition: f8config.h:571
char _cwd[FIX8_MAX_FLD_LENGTH]
Definition: f8c.hpp:209

Member Data Documentation

char FIX8::push_dir::_cwd[FIX8_MAX_FLD_LENGTH]
private

Definition at line 209 of file f8c.hpp.


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