KDECore
kconfigini.cpp
Go to the documentation of this file.
43 static QByteArray lookup(const KConfigIniBackend::BufferFragment& fragment, QHash<KConfigIniBackend::BufferFragment, QByteArray>* cache)
369 void KConfigIniBackend::writeEntries(const QByteArray& locale, QFile& file, const KEntryMap& map)
401 if (!it.key().mKey.isEmpty() && !it->bDirty) // not dirty, doesn't overwrite entry in writeMap. skips default entries, too.
417 //qDebug() << "Detected as deleted=>removed:" << key.mGroup << key.mKey << "global=" << bGlobal;
626 QByteArray result; // Guesstimated that it's good to avoid data() initialization for a length of l*4
QString i18n(const char *text)
Returns a localized version of a string.
Definition: klocalizedstring.h:630
void squeeze()
Definition: kconfigdata.h:165
const char * constData() const
Definition: bufferfragment_p.h:65
bool flush()
BufferFragment left(unsigned int size) const
Definition: bufferfragment_p.h:104
iterator insert(const Key &key, const T &value)
ParseInfo parseConfig(const QByteArray &locale, KEntryMap &entryMap, ParseOptions options)
Read persistent storage.
Definition: kconfigini.cpp:68
bool contains(const Key &key) const
Definition: kconfigdata.h:152
Definition: kconfigdata.h:164
void reserve(int size)
char at(int i) const
Definition: kmacroexpander_unix.cpp:34
KConfigBase::AccessMode accessMode() const
Definition: kconfigini.cpp:580
bool remove()
Definition: kconfigdata.h:167
void setLocalFilePath(const QString &file)
Definition: kconfigbackend.cpp:128
QFile::Permissions permissions() const
QString nonWritableErrorMessage() const
When isWritable() returns false, return an error message to explain to the user why saving configurat...
Definition: kconfigini.cpp:543
const_iterator constBegin() const
bool isNull() const
QString fileName() const
Class to allow for atomic file I/O, as well as utility functions.
Definition: ksavefile.h:96
virtual bool open(OpenMode flags=QIODevice::ReadWrite)
Open the save file.
Definition: ksavefile.cpp:81
bool isEmpty() const
void reserve(int size)
static bool checkAccess(const QString &pathname, int mode)
Check, if a file may be accessed in a given mode.
Definition: kstandarddirs.cpp:2114
void writeEntries(const QByteArray &locale, QFile &file, const KEntryMap &map)
Definition: kconfigini.cpp:369
char at(unsigned int i) const
Definition: bufferfragment_p.h:54
static QByteArray stringToPrintable(const QByteArray &aString, StringType type)
Definition: kconfigini.cpp:615
bool setPermissions(QFlags< QFile::Permission > permissions)
Automatically remove a lock when a lock is detected that is stale for more than staleTime() seconds...
Definition: klockfile.h:84
int length() const
bool exists() const
LockResult lock(LockFlags flags=LockFlags())
Attempt to acquire the lock.
Definition: klockfile_unix.cpp:386
Definition: kconfigbackend.h:103
Definition: kconfigdata.h:166
void truncate(unsigned int pos)
Definition: bufferfragment_p.h:116
QByteArray toByteArray() const
Definition: bufferfragment_p.h:171
Definition: kconfigbase.h:133
BufferFragment mid(unsigned int pos, int length=-1) const
Definition: bufferfragment_p.h:126
void resize(int size)
Definition: kconfigini_p.h:64
int indexOf(char ch, int from) const
QString canonicalFilePath() const
Definition: kconfigdata.h:169
void append(const T &value)
Definition: kconfigbackend.h:94
key structure holding both the actual key and the group to which it belongs.
Definition: kconfigdata.h:89
Definition: kconfigini_p.h:63
static QString warningProlog(const QFile &file, int line)
Definition: kconfigini.cpp:52
Definition: ksycocafactory.h:28
QByteArray & prepend(char ch)
bool isEmpty() const
static char charFromHex(const char *str, const QFile &file, int line)
Definition: kconfigini.cpp:697
const_iterator constEnd() const
const char * constData() const
QByteArray readAll()
QByteArray & replace(int pos, int len, const char *after)
Provides the implementation for accessing configuration sources.
Definition: kconfigbackend.h:55
iterator end()
QDateTime lastModified() const
QByteArray mid(int pos, int len) const
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
typedef Permissions
iterator begin()
QByteArray & append(char ch)
qint64 size() const
bool exists() const
iterator find(const Key &key)
virtual qint64 size() const
bool putChar(char c)
bool setEntry(const QByteArray &group, const QByteArray &key, const QByteArray &value, EntryOptions options)
Returns true if the entry gets dirtied or false in other case.
void setLastModified(const QDateTime &dt)
Definition: kconfigbackend.cpp:108
virtual void close()
static QByteArray lookup(const KConfigIniBackend::BufferFragment &fragment, QHash< KConfigIniBackend::BufferFragment, QByteArray > *cache)
Definition: kconfigini.cpp:43
the configuration was opened read/write
Definition: kconfigbackend.h:111
Definition: kconfigbase.h:133
static void printableToString(BufferFragment *aString, const QFile &file, int line)
Definition: kconfigini.cpp:721
BufferFragment split(char c, unsigned int *start)
Definition: bufferfragment_p.h:87
Definition: kconfigbase.h:133
bool isAbsolutePath(const QString &path)
void truncateLeft(unsigned int size)
Definition: bufferfragment_p.h:109
Definition: kconfigbackend.h:110
int indexOf(char c, unsigned int from=0) const
Definition: bufferfragment_p.h:150
QByteArray toVolatileByteArray() const
Definition: bufferfragment_p.h:177
int lastIndexOf(char c) const
Definition: bufferfragment_p.h:160
uint ownerId() const
Definition: kconfigini_p.h:62
char * data()
void setTextModeEnabled(bool enabled)
bool getEntryOption(const ConstIterator &it, EntryOption option) const
qint64 write(const char *data, qint64 maxSize)
QString fromLatin1(const char *str, int size)
void createEnclosing()
Create the enclosing object of the configuration object.
Definition: kconfigini.cpp:548
iterator end()
QString absolutePath() const
int size() const
QObject * parent() const
Definition: kconfigdata.h:163
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
bool isWritable() const
If isWritable() returns false, writeConfig() will always fail.
Definition: kconfigini.cpp:516
bool endsWith(const QByteArray &ba) const
QByteArray encodeName(const QString &fileName)
Definition: kconfigdata.h:168
bool mkpath(const QString &dirPath) const
void setTime_t(uint seconds)
int remove(const Key &key)
bool writeConfig(const QByteArray &locale, KEntryMap &entryMap, WriteOptions options, const KComponentData &data)
Write the dirty entries to permanent storage.
Definition: kconfigini.cpp:380
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.