7 #ifndef BALL_FORMAT_INIFILE_H
8 #define BALL_FORMAT_INIFILE_H
10 #ifndef BALL_DATATYPE_STRINGHASHMAP_H
14 #ifndef BALL_CONCEPT_PROCESSOR_H
38 MAX_LINE_LENGTH = 1048576
41 class IteratorTraits_;
58 bool operator == (
const Section& section)
const
60 return (name_ == section.
name_ &&
65 bool operator < (
const Section& section)
const
69 bool operator > (
const Section& section)
const
164 const String& getFilename()
const;
169 void setFilename(
const String& filename);
179 bool isValid()
const;
198 LineIterator getLine(
Size line_number);
215 bool setLine(LineIterator line_it,
const String& line);
223 bool deleteLine(LineIterator line_it);
234 bool insertLine(LineIterator line_it,
const String& line);
256 bool appendLine(
const String& section_name,
const String& line);
259 bool appendLine(
const String& line);
263 Size getNumberOfLines()
const;
271 bool hasSection(
const String& section_name)
const;
278 SectionIterator getSection(
const String& section_name);
284 SectionIterator getSection(
Position pos);
289 Size getNumberOfSections()
const;
299 LineIterator getSectionFirstLine(
const String& section_name);
307 LineIterator getSectionLastLine(
const String& section_name);
315 Size getSectionLength(
const String& section_name)
const;
322 bool deleteSection(
const String& section);
327 bool appendSection(
const String& section);
341 bool hasEntry(
const String& section,
const String& key)
const;
390 bool operator == (
const INIFile& inifile)
const;
394 bool isValid(
const LineIterator& it)
const;
398 bool isValid(
const SectionIterator& it)
const;
408 void setDuplicateKeyCheck(
bool mode);
412 bool duplicateKeyCheckEnabled()
const;
415 std::list<String> getContent()
const
419 bool setContent(
const std::list<String>& lines)
451 IteratorTraits_(const IteratorTraits_& traits);
454 virtual ~IteratorTraits_();
457 const IteratorTraits_& operator = (const IteratorTraits_ &traits);
460 std::list<
String>::iterator getPosition();
463 SectionIterator getSection();
466 const
String& operator * () const;
469 IteratorTraits_& operator ++ ();
472 IteratorTraits_& operator -- ();
475 IteratorTraits_& getSectionNextLine();
478 bool operator == (const IteratorTraits_& traits) const;
481 bool operator != (const IteratorTraits_& traits) const;
484 bool operator + () const;
487 bool isValid() const;
490 void toSectionFirstLine();
493 void toSectionLastLine();
499 bool isSectionFirstLine() const;
502 bool isSectionLastLine() const;
505 bool isSectionEnd() const;
520 SectionIterator section,
527 void setLine_(const
String& line);
532 SectionIterator section_;
538 #endif // BALL_FORMAT_INIFILE_H
std::list< Section > sections_
#define BALL_CREATE(name)
static const String HEADER
StringHashMap< std::list< String >::iterator > key_map_
std::list< Section >::iterator SectionIterator
static const String UNDEFINED
StringHashMap< SectionIterator > section_index_
Interface for the LineIterator.
bool check_duplicate_keys_
std::list< String > lines_
const String & getName() const
-*- Mode: C++; tab-width: 2; -*-
IteratorTraits_ LineIterator