Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
qx-common-io_p.h
1#ifndef QX_IO_COMMON_P_H
2#define QX_IO_COMMON_P_H
3
4// Qt Includes
5#include <QFileDevice>
6#include <QTextStream>
7
8// Intra-component Includes
9#include "qx/io/qx-ioopreport.h"
10#include "qx/io/qx-common-io.h"
11
12namespace Qx
13{
16//-Component Private Enums -------------------------------------------------------------------------------------------------
17enum class Existance {Exist, NotExist, Either};
18
19//-Component Private Variables ---------------------------------------------------------------------------------------------
20extern const QHash<QFileDevice::FileError, IoOpResultType> FILE_DEV_ERR_MAP;
21extern const QHash<QTextStream::Status, IoOpResultType> TXT_STRM_STAT_MAP;
22extern const QHash<QDataStream::Status, IoOpResultType> DATA_STRM_STAT_MAP;
23
24//-Component Private Functions-----------------------------------------------------------------------------------------------------
25Existance existanceReqFromWriteOptions(WriteOptions wo);
26IoOpResultType parsedOpen(QFileDevice* file, QIODevice::OpenMode openMode);
27IoOpResultType fileCheck(const QFileInfo& fileInfo, Existance existanceRequirement);
28IoOpResultType directoryCheck(const QFileInfo& dirInfo);
29IoOpReport handlePathCreation(const QFileInfo& fileInfo, bool createPaths);
30IoOpReport writePrep(const QFileInfo& fileInfo, WriteOptions writeOptions);
31void matchAppendConditionParams(WriteMode& writeMode, TextPos& startPos);
32
33template<typename T>
34void matchAppendConditionParams(WriteMode& writeMode, Index<T>& startPos)
35{
36 // Match append condition parameters
37 if(startPos.isLast())
38 writeMode = Append;
39 else if(writeMode == Append)
40 startPos = Index<T>(Last);
41}
43}
44
45#endif // QX_IO_COMMON_P_H
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
WriteMode
Definition qx-common-io.h:27
@ Append
Definition qx-common-io.h:27
@ Last
Definition qx-global.h:21
IoOpResultType
Definition qx-ioopreport.h:21
QFlags< WriteOption > WriteOptions
Definition qx-common-io.h:38
typedef OpenMode
The qx-common-io header file provides various types, variables, and functions related to file IO.