Instrument Neutral Distributed Interface INDI 2.2.5
Public Member Functions | List of all members
ini::IniFileBase< Comparator > Class Template Reference

#include <inicpp.h>

Inheritance diagram for ini::IniFileBase< Comparator >:

Public Member Functions

 IniFileBase ()=default
 
 IniFileBase (const char fieldSep, const char comment)
 
 IniFileBase (const std::string &filename)
 
 IniFileBase (std::istream &is)
 
 IniFileBase (const char fieldSep, const std::vector< std::string > &commentPrefixes)
 
 IniFileBase (const std::string &filename, const char fieldSep, const std::vector< std::string > &commentPrefixes)
 
 IniFileBase (std::istream &is, const char fieldSep, const std::vector< std::string > &commentPrefixes)
 
 ~IniFileBase ()
 
void setFieldSep (const char sep)
 
void setCommentChar (const char comment)
 
void setCommentPrefixes (const std::vector< std::string > &commentPrefixes)
 
void setEscapeChar (const char esc)
 
void setMultiLineValues (bool enable)
 
void decode (std::istream &is)
 
void decode (const std::string &content)
 
void load (const std::string &fileName)
 
void encode (std::ostream &os) const
 
std::string encode () const
 
void save (const std::string &fileName) const
 

Detailed Description

template<typename Comparator>
class ini::IniFileBase< Comparator >

Definition at line 415 of file inicpp.h.

Constructor & Destructor Documentation

◆ IniFileBase() [1/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( )
default

◆ IniFileBase() [2/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( const char  fieldSep,
const char  comment 
)
inline

Definition at line 503 of file inicpp.h.

◆ IniFileBase() [3/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( const std::string &  filename)
inline

Definition at line 507 of file inicpp.h.

◆ IniFileBase() [4/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( std::istream &  is)
inline

Definition at line 512 of file inicpp.h.

◆ IniFileBase() [5/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( const char  fieldSep,
const std::vector< std::string > &  commentPrefixes 
)
inline

Definition at line 517 of file inicpp.h.

◆ IniFileBase() [6/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( const std::string &  filename,
const char  fieldSep,
const std::vector< std::string > &  commentPrefixes 
)
inline

Definition at line 522 of file inicpp.h.

◆ IniFileBase() [7/7]

template<typename Comparator >
ini::IniFileBase< Comparator >::IniFileBase ( std::istream &  is,
const char  fieldSep,
const std::vector< std::string > &  commentPrefixes 
)
inline

Definition at line 530 of file inicpp.h.

◆ ~IniFileBase()

template<typename Comparator >
ini::IniFileBase< Comparator >::~IniFileBase ( )
inline

Definition at line 538 of file inicpp.h.

Member Function Documentation

◆ decode() [1/2]

template<typename Comparator >
void ini::IniFileBase< Comparator >::decode ( const std::string &  content)
inline

Tries to decode a ini file from the given input string.

Parameters
contentstring to be decoded.

Definition at line 684 of file inicpp.h.

◆ decode() [2/2]

template<typename Comparator >
void ini::IniFileBase< Comparator >::decode ( std::istream &  is)
inline

Tries to decode a ini file from the given input stream.

Parameters
isinput stream from which data should be read.

Definition at line 586 of file inicpp.h.

◆ encode() [1/2]

template<typename Comparator >
std::string ini::IniFileBase< Comparator >::encode ( ) const
inline

Encodes this inifile object as string and returns the result.

Returns
encoded infile string.

Definition at line 723 of file inicpp.h.

◆ encode() [2/2]

template<typename Comparator >
void ini::IniFileBase< Comparator >::encode ( std::ostream &  os) const
inline

Encodes this inifile object and writes the output to the given stream.

Parameters
ostarget stream.

Definition at line 700 of file inicpp.h.

◆ load()

template<typename Comparator >
void ini::IniFileBase< Comparator >::load ( const std::string &  fileName)
inline

Tries to load and decode a ini file from the file at the given path.

Parameters
fileNamepath to the file that should be loaded.

Definition at line 692 of file inicpp.h.

◆ save()

template<typename Comparator >
void ini::IniFileBase< Comparator >::save ( const std::string &  fileName) const
inline

Saves this inifile object to the file at the given path.

Parameters
fileNamepath to the file where the data should be stored.

Definition at line 732 of file inicpp.h.

◆ setCommentChar()

template<typename Comparator >
void ini::IniFileBase< Comparator >::setCommentChar ( const char  comment)
inline

Sets the character that should be interpreted as the start of comments. Default is '#'. Note: If the inifile contains the comment character as data it must be prefixed with the configured escape character.

Parameters
commentcomment character to be used.

Definition at line 553 of file inicpp.h.

◆ setCommentPrefixes()

template<typename Comparator >
void ini::IniFileBase< Comparator >::setCommentPrefixes ( const std::vector< std::string > &  commentPrefixes)
inline

Sets the list of strings that should be interpreted as the start of comments. Default is [ "#" ]. Note: If the inifile contains any comment string as data it must be prefixed with the configured escape character.

Parameters
commentPrefixesvector of comment prefix strings to be used.

Definition at line 563 of file inicpp.h.

◆ setEscapeChar()

template<typename Comparator >
void ini::IniFileBase< Comparator >::setEscapeChar ( const char  esc)
inline

Sets the character that should be used to escape comment prefixes. Default is '\'.

Parameters
escescape character to be used.

Definition at line 571 of file inicpp.h.

◆ setFieldSep()

template<typename Comparator >
void ini::IniFileBase< Comparator >::setFieldSep ( const char  sep)
inline

Sets the separator character for fields in the INI file.

Parameters
sepseparator character to be used.

Definition at line 543 of file inicpp.h.

◆ setMultiLineValues()

template<typename Comparator >
void ini::IniFileBase< Comparator >::setMultiLineValues ( bool  enable)
inline

Sets whether or not to parse multi-line field values. Default is false.

Parameters
enableenable or disable?

Definition at line 579 of file inicpp.h.


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