Parasol Planning Library (PPL)
Functions | Variables
IOUtils.h File Reference
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include "CountingStreamBuffer.h"
#include "PMPLExceptions.h"
Include dependency graph for IOUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void VDInit (std::string _filename)
 @TODO More...
 
void VDClose ()
 @TODO More...
 
void VDComment (std::string _s)
 @TODO More...
 
void VDClearAll ()
 @TODO More...
 
void VDClearLastTemp ()
 @TODO More...
 
void VDClearComments ()
 @TODO More...
 
template<typename CfgType >
void VDAddNode (const CfgType &_cfg)
 @TODO More...
 
template<typename CfgType >
void VDRemoveNode (const CfgType &_cfg)
 @TODO More...
 
template<typename CfgType >
void VDAddEdge (const CfgType &_cfg1, const CfgType &_cfg2)
 @TODO More...
 
template<typename CfgType >
void VDRemoveEdge (const CfgType &_cfg1, const CfgType &_cfg2)
 @TODO More...
 
template<typename CfgType >
void VDAddTempCfg (const CfgType &_cfg, const bool _valid)
 @TODO More...
 
template<typename CfgType >
void VDAddTempRay (const CfgType &_cfg)
 @TODO More...
 
template<typename CfgType >
void VDAddTempEdge (const CfgType &_cfg1, const CfgType &_cfg2)
 @TODO More...
 
template<typename AbstractRoadmapType >
void VDTrackRoadmap (AbstractRoadmapType *const _r)
 
template<typename CfgType >
void WritePath (const std::string &_filename, const std::vector< CfgType > &_path)
 Write a list of Cfgs from a path to file. More...
 
template<typename CfgType >
std::vector< CfgType > ReadPath (const std::string &_filename, Robot *const _robot)
 Read a list of Cfgs from a file to path. More...
 
bool FileExists (const std::string &_filename)
 
void GoToNext (std::istream &_is)
 
bool IsCommentLine (const char _c)
 
std::string GetPathName (const std::string &_filename)
 
template<typename T >
ReadField (std::istream &_is, CountingStreamBuffer &_cbs, const std::string &_desc)
 
std::string ReadFieldString (std::istream &_is, CountingStreamBuffer &_cbs, const std::string &_desc, const bool _toUpper=true)
 
std::vector< std::string > GetTokens (std::string _s, std::string _delimiters)
 

Variables

std::ofstream * vdo
 @TODO More...
 

Function Documentation

◆ FileExists()

bool FileExists ( const std::string &  _filename)

Determine whether a file exists.

Parameters
_filenameThe name of the file to check.
Returns
True if the named file exists.

◆ GetPathName()

std::string GetPathName ( const std::string &  _filename)

Get directory path from filename

Parameters
_filenameFilename
Returns
Directory

◆ GetTokens()

std::vector<std::string> GetTokens ( std::string  _s,
std::string  _delimiters 
)

Split string based on delimiter.

Parameters
_sThe string to split.
_delimitersThe delimiters to split on.
Returns
The set of tokens.

◆ GoToNext()

void GoToNext ( std::istream &  _is)

Discard all commented lines until the next uncommented line is found

Parameters
_isStream

◆ IsCommentLine()

bool IsCommentLine ( const char  _c)

Determines if character starts a comment ('#')

Parameters
_cCharacter in question
Returns
Comment or not, that is the question

◆ ReadField()

template<typename T >
T ReadField ( std::istream &  _is,
CountingStreamBuffer _cbs,
const std::string &  _desc 
)

Read data from stream

Template Parameters
TData type
Parameters
_isStream
_cbsCounting stream buffer
_descString describing field
Returns
Data

◆ ReadFieldString()

std::string ReadFieldString ( std::istream &  _is,
CountingStreamBuffer _cbs,
const std::string &  _desc,
const bool  _toUpper = true 
)

Read string from stream

Parameters
_isStream
_cbsCounting stream buffer
_descString describing field
_toUpperTrue means convert string to all upper case
Returns
Data string

◆ ReadPath()

template<typename CfgType >
std::vector<CfgType> ReadPath ( const std::string &  _filename,
Robot *const  _robot 
)

Read a list of Cfgs from a file to path.

◆ VDAddEdge()

template<typename CfgType >
void VDAddEdge ( const CfgType &  _cfg1,
const CfgType &  _cfg2 
)

@TODO

◆ VDAddNode()

template<typename CfgType >
void VDAddNode ( const CfgType &  _cfg)

@TODO

◆ VDAddTempCfg()

template<typename CfgType >
void VDAddTempCfg ( const CfgType &  _cfg,
const bool  _valid 
)

@TODO

◆ VDAddTempEdge()

template<typename CfgType >
void VDAddTempEdge ( const CfgType &  _cfg1,
const CfgType &  _cfg2 
)

@TODO

◆ VDAddTempRay()

template<typename CfgType >
void VDAddTempRay ( const CfgType &  _cfg)

@TODO

◆ VDClearAll()

void VDClearAll ( )

@TODO

◆ VDClearComments()

void VDClearComments ( )

@TODO

◆ VDClearLastTemp()

void VDClearLastTemp ( )

@TODO

◆ VDClose()

void VDClose ( )

@TODO

◆ VDComment()

void VDComment ( std::string  _s)

@TODO

◆ VDInit()

void VDInit ( std::string  _filename)

@TODO

◆ VDRemoveEdge()

template<typename CfgType >
void VDRemoveEdge ( const CfgType &  _cfg1,
const CfgType &  _cfg2 
)

@TODO

◆ VDRemoveNode()

template<typename CfgType >
void VDRemoveNode ( const CfgType &  _cfg)

@TODO

◆ VDTrackRoadmap()

template<typename AbstractRoadmapType >
void VDTrackRoadmap ( AbstractRoadmapType *const  _r)

Add hook functions to track roadmap changes in the vizmo debug file.

Parameters
_rThe roadmap to track.

◆ WritePath()

template<typename CfgType >
void WritePath ( const std::string &  _filename,
const std::vector< CfgType > &  _path 
)

Write a list of Cfgs from a path to file.

Variable Documentation

◆ vdo

std::ofstream* vdo
extern

@TODO