IniFile
Loading...
Searching...
No Matches
IniFile.h
Go to the documentation of this file.
1#ifndef INC_INIFILE_H
2#define INC_INIFILE_H
3//-----------------------------------------------------------------------------
52//-----------------------------------------------------------------------------
53#include "IniFileTypes.h"
54#include "PtlTDVList.h"
55#include "IniLineFactory.h"
56#include "IniSection.h"
57#include "IniKey.h"
58#include "string"
59//-----------------------------------------------------------------------------
60// Forwards
61namespace eut
62{
63 class Blob;
64}
65//-----------------------------------------------------------------------------
66namespace ini
67{
68 //---------------------------------------------------------------------------
69 #ifdef _MSC_VER
70 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
71 #pragma warning( disable : 4251 )
72 #endif
73 //---------------------------------------------------------------------------
313 {
314 private:
315 //============== Attribute ============
316 //-----------------------------------------------------------------------
326 std::string m_sFileName;
327 //-----------------------------------------------------------------------
338 //-----------------------------------------------------------------------
349 //-----------------------------------------------------------------------
350
351 public:
352 //============== Konstruktoren ============
353 //-----------------------------------------------------------------------
377 File( const std::string & rsFullFileName, TdOpenInifileMode openMode );
378 //-----------------------------------------------------------------------
389 //-----------------------------------------------------------------------
399 virtual ~File();
400 //-----------------------------------------------------------------------
401
402 private:
403 //-----------------------------------------------------------------------
413 File( const File & );
414 //-----------------------------------------------------------------------
415
416 public:
417 //============== Datei-Methoden
418 //-----------------------------------------------------------------------
430 int store();
431 //-----------------------------------------------------------------------
445 int refresh();
446 //-----------------------------------------------------------------------
447
448 //============== Methoden
449 //-----------------------------------------------------------------------
462 void setFullFileName( const std::string & rsFullFileName );
463 //-----------------------------------------------------------------------
475 std::string getFileName();
476 //-----------------------------------------------------------------------
515 int getLine( Line *& prRetVal, std::size_t nPosition, ptl::SeekMode eMode );
516 //-----------------------------------------------------------------------
550 int insertLine( Line * pIniLine,
551 ptl::InsertPosition eInsertPosition = ptl::InsertCURRENT,
552 ptl::VH eBeforeBehind = ptl::BEHIND );
553 //-----------------------------------------------------------------------
580 //-----------------------------------------------------------------------
613 int getLine( Line *& prRetVal, std::string * psSection, std::string * psKey = 0 );
614 //-----------------------------------------------------------------------
665 int getKeyValue( std::string & rsValue, std::string * psSection, std::string * psKey );
666 //-----------------------------------------------------------------------
703 int setKeyValue( const std::string & rsSection,
704 const std::string & rsKey,
705 const std::string & rsValue );
706 //-----------------------------------------------------------------------
737 int removeKey( const std::string & rsSection, const std::string & rsKey );
738 //-----------------------------------------------------------------------
755 int getAsBlob( eut::Blob *& prBlob );
756 //-----------------------------------------------------------------------
772 int makeLines( eut::Blob * pBlob );
773 //-----------------------------------------------------------------------
774
775 private:
776 //============== Operatoren
777 //-----------------------------------------------------------------------
787 File & operator= ( const File & );
788 //-----------------------------------------------------------------------
789 };
790 //---------------------------------------------------------------------------
791 #ifdef _MSC_VER
792 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
793 #pragma warning( default : 4251 )
794 #endif
795 //---------------------------------------------------------------------------
796} // namespace ini
797//-----------------------------------------------------------------------------
798#endif
For each library, here 'IniFile' there is a type definition file.
#define __ini_file_export_dll
Definition IniFileTypes.h:68
Header for Key
Header for LineFactory
Header for Section
Header for TDVList
This class allows to edit a blob (insert, copy, search etc.).
Definition EuBlob.h:75
An INI file contains information for programs.
Definition IniFile.h:313
int removeLine(ptl::ElementPosition eFirstLastCurrent=ptl::CURRENT_POS)
int insertLine(Line *pIniLine, ptl::InsertPosition eInsertPosition=ptl::InsertCURRENT, ptl::VH eBeforeBehind=ptl::BEHIND)
virtual ~File()
int makeLines(eut::Blob *pBlob)
File(const File &)
int refresh()
int store()
std::string getFileName()
std::string m_sFileName
Definition IniFile.h:326
ptl::TDVList< Line > m_LineList
Definition IniFile.h:337
LineFactory m_LineFactory
Definition IniFile.h:348
File(const std::string &rsFullFileName, TdOpenInifileMode openMode)
int getAsBlob(eut::Blob *&prBlob)
void setFullFileName(const std::string &rsFullFileName)
int getLine(Line *&prRetVal, std::size_t nPosition, ptl::SeekMode eMode)
int setKeyValue(const std::string &rsSection, const std::string &rsKey, const std::string &rsValue)
int removeKey(const std::string &rsSection, const std::string &rsKey)
int getLine(Line *&prRetVal, std::string *psSection, std::string *psKey=0)
int getKeyValue(std::string &rsValue, std::string *psSection, std::string *psKey)
This class turns lines of an INI file into objects of the types Line, Section or Key.
Definition IniLineFactory.h:76
Is a comment line, but also superclass for Section and Key.
Definition IniLine.h:77
Template list class for pointers to objects.
Definition PtlTDVList.h:113
Definition EuBlob.h:58
Definition IniFile.h:67
bool TdOpenInifileMode
Definition IniFileTypes.h:200
InsertPosition
Definition PtlListTypes.h:201
@ InsertCURRENT
Definition PtlListTypes.h:204
VH
Definition PtlListTypes.h:157
@ BEHIND
Definition PtlListTypes.h:159
ElementPosition
Definition PtlListTypes.h:120
@ CURRENT_POS
Definition PtlListTypes.h:123
SeekMode
Definition PtlListTypes.h:369