Skip to content

Commit

Permalink
before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
maisvendoo committed Sep 11, 2018
1 parent 4bdf667 commit 8bc60b8
Show file tree
Hide file tree
Showing 57 changed files with 4,564 additions and 4,564 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.pro.user
*.pro.user.*

*.pro.user
*.pro.user.*

44 changes: 22 additions & 22 deletions CfgReader/CfgReader.pro
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
TEMPLATE = lib

QT -= qui
QT += xml

TARGET = CfgReader

DEFINES += CFG_READER_LIB

DESTDIR = ../../lib

CONFIG(debug, debug|release) {

TARGET = $$join(TARGET,,,_d)
} else {

}

INCLUDEPATH += ./include

HEADERS += $$files(./include/*.h)
SOURCES += $$files(./src/*.cpp)
TEMPLATE = lib

QT -= qui
QT += xml

TARGET = CfgReader

DEFINES += CFG_READER_LIB

DESTDIR = ../../lib

CONFIG(debug, debug|release) {

TARGET = $$join(TARGET,,,_d)
} else {

}

INCLUDEPATH += ./include

HEADERS += $$files(./include/*.h)
SOURCES += $$files(./src/*.cpp)
178 changes: 89 additions & 89 deletions CfgReader/include/CfgReader.h
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
//------------------------------------------------------------------------------
//
// XML config reader library
// (с) maisvendoo 17/09/2016
// Developer: Dmitry Pritykin
//
//------------------------------------------------------------------------------
/*!
* \file
* \brief XML config reader library
* \copyright maisvendoo
* \author Dmitry Pritykin
* \date 17/09/2016
*/

#ifndef CFGREADER_H
#define CFGREADER_H

#include <QDomDocument>
#include <QDomElement>
#include <QDomNode>
#include <QString>
#include <QFile>
#include <QtGlobal>

#if defined(CFG_READER_LIB)
#define CFG_READER_EXPORT Q_DECL_EXPORT
#else
#define CFG_READER_EXPORT Q_DECL_IMPORT
#endif

/*!
* \class CfgReader
* \brief Work with XML config file
*/
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
class CFG_READER_EXPORT CfgReader
{
public:

CfgReader();
~CfgReader();

/// Loading of XML file
bool load(QString path);

/// Find first section by name
QDomNode getFirstSection(QString section);
/// Find next section
QDomNode getNextSection();

/// Get field in section
QDomNode getField(QDomNode secNode, QString field);

/// Get string field
bool getString(QString section, QString field, QString &value);
/// Get string field
bool getString(QDomNode secNode, QString field, QString &value);
/// Get double field
bool getDouble(QString section, QString filed, double &value);
/// Get double field
bool getDouble(QDomNode secNode, QString field, double &value);
/// Get integer field
bool getInt(QString section, QString filed, int &value);
/// Get integer field
bool getInt(QDomNode secNode, QString field, int &value);
/// Get boolean filed
bool getBool(QString section, QString field, bool &value);
/// Get boolean field
bool getBool(QDomNode secNode, QString field, bool &value);

private:

/// File object
QFile *file;
/// File name
QString file_name;
/// Document object
QDomDocument domDoc;
/// First element in document
QDomElement firstElement;
/// Current document node for parsed file
QDomNode curNode;
};

#endif // CFGREADER_H

//------------------------------------------------------------------------------
//
// XML config reader library
// (с) maisvendoo 17/09/2016
// Developer: Dmitry Pritykin
//
//------------------------------------------------------------------------------
/*!
* \file
* \brief XML config reader library
* \copyright maisvendoo
* \author Dmitry Pritykin
* \date 17/09/2016
*/

#ifndef CFGREADER_H
#define CFGREADER_H

#include <QDomDocument>
#include <QDomElement>
#include <QDomNode>
#include <QString>
#include <QFile>
#include <QtGlobal>

#if defined(CFG_READER_LIB)
#define CFG_READER_EXPORT Q_DECL_EXPORT
#else
#define CFG_READER_EXPORT Q_DECL_IMPORT
#endif

/*!
* \class CfgReader
* \brief Work with XML config file
*/
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
class CFG_READER_EXPORT CfgReader
{
public:

CfgReader();
~CfgReader();

/// Loading of XML file
bool load(QString path);

/// Find first section by name
QDomNode getFirstSection(QString section);
/// Find next section
QDomNode getNextSection();

/// Get field in section
QDomNode getField(QDomNode secNode, QString field);

/// Get string field
bool getString(QString section, QString field, QString &value);
/// Get string field
bool getString(QDomNode secNode, QString field, QString &value);
/// Get double field
bool getDouble(QString section, QString filed, double &value);
/// Get double field
bool getDouble(QDomNode secNode, QString field, double &value);
/// Get integer field
bool getInt(QString section, QString filed, int &value);
/// Get integer field
bool getInt(QDomNode secNode, QString field, int &value);
/// Get boolean filed
bool getBool(QString section, QString field, bool &value);
/// Get boolean field
bool getBool(QDomNode secNode, QString field, bool &value);

private:

/// File object
QFile *file;
/// File name
QString file_name;
/// Document object
QDomDocument domDoc;
/// First element in document
QDomElement firstElement;
/// Current document node for parsed file
QDomNode curNode;
};

#endif // CFGREADER_H

58 changes: 29 additions & 29 deletions CfgReader/include/convert.h
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
//------------------------------------------------------------------------------
//
// Strings to numbers conversion
// (с) maisvendoo 17/09/2016
// Devleloper: Dmitry Pritykin
//
//------------------------------------------------------------------------------
/*!
* \file
* \brief Strings to numbers conversion
* \copyright maisvendoo
* \author Dmitry Pritykin
* \date 17/09/2016
*/

#ifndef CONVERT_H
#define CONVERT_H

#include <QString>
#include <QtGlobal>

/// QString to double
extern "C" Q_DECL_EXPORT bool TextToDouble(QString text, double &value);
/// QString to integer
extern "C" Q_DECL_EXPORT bool TextToInt(QString text, int &value);
/// Erase all spaces from QString
QString EraseSpaces(QString str);

#endif
//------------------------------------------------------------------------------
//
// Strings to numbers conversion
// (с) maisvendoo 17/09/2016
// Devleloper: Dmitry Pritykin
//
//------------------------------------------------------------------------------
/*!
* \file
* \brief Strings to numbers conversion
* \copyright maisvendoo
* \author Dmitry Pritykin
* \date 17/09/2016
*/

#ifndef CONVERT_H
#define CONVERT_H

#include <QString>
#include <QtGlobal>

/// QString to double
extern "C" Q_DECL_EXPORT bool TextToDouble(QString text, double &value);
/// QString to integer
extern "C" Q_DECL_EXPORT bool TextToInt(QString text, int &value);
/// Erase all spaces from QString
QString EraseSpaces(QString str);

#endif
Loading

0 comments on commit 8bc60b8

Please sign in to comment.