587ae25b84177c5af73d1794bba555c6643b39bd
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp     1) /* Blinker
src/noarch/SettingFile.cpp     2)    Copyright 2011 Stefan Schuermans <stefan@blinkenarea.org>
src/noarch/SettingFile.cpp     3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
src/noarch/SettingFile.cpp     4)    a blinkenarea.org project */
src/noarch/SettingFile.cpp     5) 
Stefan Schuermans namespace for preprocessor...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h  6) #ifndef BLINKER_SETTINGFILE_IMPL_H
src/noarch/SettingFile_impl.h  7) #define BLINKER_SETTINGFILE_IMPL_H
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h  8) 
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp     9) #include <fstream>
src/noarch/SettingFile.cpp    10) #include <string>
src/noarch/SettingFile.cpp    11) 
src/noarch/SettingFile.cpp    12) #include "File.h"
src/noarch/SettingFile.cpp    13) #include "SettingFile.h"
src/noarch/SettingFile.cpp    14) 
src/noarch/SettingFile.cpp    15) namespace Blinker {
src/noarch/SettingFile.cpp    16) 
src/noarch/SettingFile.cpp    17) /**
src/noarch/SettingFile.cpp    18)  * @brief constructor from path
src/noarch/SettingFile.cpp    19)  * @param[in] path path to file
src/noarch/SettingFile.cpp    20)  */
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 21) template<typename TYPE>
src/noarch/SettingFile_impl.h 22) SettingFile<TYPE>::SettingFile(const std::string &path):
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    23)   File(path)
src/noarch/SettingFile.cpp    24) {
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 25)   update();
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    26) }
src/noarch/SettingFile.cpp    27) 
src/noarch/SettingFile.cpp    28) /**
src/noarch/SettingFile.cpp    29)  * @brief constructor from basic file
src/noarch/SettingFile.cpp    30)  * @param[in] file basic file object
src/noarch/SettingFile.cpp    31)  */
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 32) template<typename TYPE>
src/noarch/SettingFile_impl.h 33) SettingFile<TYPE>::SettingFile(const File &file):
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    34)   File(file)
src/noarch/SettingFile.cpp    35) {
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 36)   update();
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    37) }
src/noarch/SettingFile.cpp    38) 
src/noarch/SettingFile.cpp    39) /**
src/noarch/SettingFile.cpp    40)  * @brief assignment operator
src/noarch/SettingFile.cpp    41)  * @param[in] file basic file object
src/noarch/SettingFile.cpp    42)  */
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 43) template<typename TYPE>
src/noarch/SettingFile_impl.h 44) const SettingFile<TYPE> & SettingFile<TYPE>::operator=(const File &file)
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    45) {
src/noarch/SettingFile.cpp    46)   File::operator=(file);
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 47)   update();
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    48)   return *this;
src/noarch/SettingFile.cpp    49) }
src/noarch/SettingFile.cpp    50) 
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 51) /// update, i.e. (re-)read file
src/noarch/SettingFile_impl.h 52) template<typename TYPE>
src/noarch/SettingFile_impl.h 53) void SettingFile<TYPE>::update()
src/noarch/SettingFile_impl.h 54) {
src/noarch/SettingFile_impl.h 55)   std::string strSize;
src/noarch/SettingFile_impl.h 56) 
src/noarch/SettingFile_impl.h 57)   m_valid = getStr(strSize) && m_obj.fromStr(strSize);
src/noarch/SettingFile_impl.h 58) }
src/noarch/SettingFile_impl.h 59) 
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    60) /**
src/noarch/SettingFile.cpp    61)  * @brief get setting as string
src/noarch/SettingFile.cpp    62)  * @param[out] val setting read from file
src/noarch/SettingFile.cpp    63)  * @return if setting was successfully read from file
src/noarch/SettingFile.cpp    64)  */
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 65) template<typename TYPE>
src/noarch/SettingFile_impl.h 66) bool SettingFile<TYPE>::getStr(std::string &val) const
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    67) {
src/noarch/SettingFile.cpp    68)   std::ifstream ifstrm(m_path.c_str(), std::ios::in);
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 69)   if (!ifstrm.is_open())
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    70)     return false;
src/noarch/SettingFile.cpp    71) 
src/noarch/SettingFile.cpp    72)   std::getline(ifstrm, val);
Stefan Schuermans implemented specialized set...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 73)   if (ifstrm.fail())
Stefan Schuermans implemented stream printer...

Stefan Schuermans authored 13 years ago

src/noarch/SettingFile.cpp    74)     return false;
src/noarch/SettingFile.cpp    75) 
src/noarch/SettingFile.cpp    76)   ifstrm.close();
src/noarch/SettingFile.cpp    77) 
src/noarch/SettingFile.cpp    78)   return true;
src/noarch/SettingFile.cpp    79) }
src/noarch/SettingFile.cpp    80) 
src/noarch/SettingFile.cpp    81) } // namespace Blinker
src/noarch/SettingFile.cpp    82) 
Stefan Schuermans namespace for preprocessor...

Stefan Schuermans authored 12 years ago

src/noarch/SettingFile_impl.h 83) #endif // #ifndef BLINKER_SETTINGFILE_IMPL_H