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/FITKDictArray.h

225 lines
7.2 KiB
C

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