• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.2 API Reference
  • KDE Home
  • Contact Us
 

KDECore

  • kdecore
  • config
kconfigini_p.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE libraries
3  Copyright (c) 2006, 2007 Thomas Braxton <kde.braxton@gmail.com>
4  Copyright (c) 1999 Preston Brown <pbrown@kde.org>
5  Portions copyright (c) 1997 Matthias Kalle Dalheimer <kalle@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef KCONFIGINI_P_H
24 #define KCONFIGINI_P_H
25 
26 #include <kdecore_export.h>
27 #include <kconfigbackend.h>
28 #include <klockfile.h>
29 
30 class KConfigIniBackend : public KConfigBackend
31 {
32 private:
33  class BufferFragment;
34 
35  KLockFile::Ptr lockFile;
36 public:
37 
38  KConfigIniBackend();
39  ~KConfigIniBackend();
40 
41  ParseInfo parseConfig(const QByteArray& locale,
42  KEntryMap& entryMap,
43  ParseOptions options);
44  ParseInfo parseConfig(const QByteArray& locale,
45  KEntryMap& entryMap,
46  ParseOptions options,
47  bool merging);
48  bool writeConfig(const QByteArray& locale, KEntryMap& entryMap,
49  WriteOptions options, const KComponentData &data);
50 
51  bool isWritable() const;
52  QString nonWritableErrorMessage() const;
53  KConfigBase::AccessMode accessMode() const;
54  void createEnclosing();
55  void setFilePath(const QString& path);
56  bool lock(const KComponentData& componentData);
57  void unlock();
58  bool isLocked() const;
59 
60 protected:
61 
62  enum StringType {
63  GroupString = 0,
64  KeyString = 1,
65  ValueString = 2
66  };
67  // Warning: this modifies data in-place. Other BufferFragment objects referencing the same buffer
68  // fragment will get their data modified too.
69  static void printableToString(BufferFragment* aString, const QFile& file, int line);
70  static QByteArray stringToPrintable(const QByteArray& aString, StringType type);
71  static char charFromHex(const char *str, const QFile& file, int line);
72  static QString warningProlog(const QFile& file, int line);
73 
74  void writeEntries(const QByteArray& locale, QFile& file, const KEntryMap& map);
75  void writeEntries(const QByteArray& locale, QFile& file, const KEntryMap& map,
76  bool defaultGroup, bool &firstEntry);
77 };
78 
79 #endif // KCONFIGINI_P_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Apr 16 2013 20:55:38 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.10.2 API Reference

Skip menu "kdelibs-4.10.2 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal