You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/FITK_Component/FITKOFDictWriter/FITKDictObject.h

225 lines
7.1 KiB
C

/**
* @file FITKDictObject.h
* @brief
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-15
*/
#ifndef _FITKDICTOBJECT_H__
#define _FITKDICTOBJECT_H__
#include "FITKOFDictWriterAPI.h"
#include "FITKAbstractDict.h"
#include <QList>
class QTextStream;
namespace DICT
{
class FITKDictValue;
/**
* @brief
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-15
*/
class FITKOFDictWriterAPI FITKDictObject
{
public:
explicit FITKDictObject() = default;
FITKDictObject(const FITKDictObject &other);
~FITKDictObject();
FITKDictObject &operator=(const FITKDictObject &other);
/**
* @brief
* @return int
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
int count() const;
/**
* @brief
* @param[i] key
* @return DICT::FITKDictValue*
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
FITKDictValue* value(const QString key);
/**
* @brief
* @param[i] index
* @return DICT::FITKDictValue*
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
FITKDictValue* at(const int index);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, FITKAbstractDict::DictType value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, bool value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, double value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, int value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, const QString &value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, const char *value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, const QStringList &value);
/**
* @brief
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void append(QString key, FITKAbstractDict* value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, FITKAbstractDict::DictType value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, bool value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, double value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, int value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, const QString &value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, const char *value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, const QStringList& value);
/**
* @brief
* @param[i] index
* @param[i] key
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-17
*/
void insert(int index, QString key, FITKAbstractDict* value);
/**
* @brief
* @param[i] i
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
void removeAt(int index);
/**
* @brief
* @param[i] key
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
void removeKey(QString key);
/**
* @brief
* @param[i] stream
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
void writeObjectDict(QTextStream* stream);
private:
/**
* @brief
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
QList<FITKDictValue*> m_values{};
};
}
#endif