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

144 lines
4.2 KiB
C

/**
* @file FITKDictVector.h
* @brief (value value value) [value value value]
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
#ifndef _FITKDICTVECTOR_H__
#define _FITKDICTVECTOR_H__
#include "FITKOFDictWriterAPI.h"
#include "FITKAbstractDict.h"
namespace DICT
{
class FITKDictValue;
/**
* @brief -
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-15
*/
class FITKOFDictWriterAPI FITKDictVector : public FITKAbstractDict
{
public:
enum ParenthesesType
{
NoneParentheses,
SmallParentheses,
MiddleParentheses,
LargeParentheses,
};
explicit FITKDictVector() = default;
FITKDictVector(const FITKDictVector &other);
~FITKDictVector() override;
FITKDictVector &operator=(const FITKDictVector &other);
/**
* @brief
* @return
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
DictType getDictType() override;
/**
* @brief
* @param[i] type ParenthesesType
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
void setParenthesesType(ParenthesesType type);
/**
* @brief
* @return ParenthesesType
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
ParenthesesType getParenthesesType();
/**
* @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 value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
void append(FITKAbstractDict::DictType value);
void append(bool value);
void append(double value);
void append(int value);
void append(const QString &value);
void append(const char *value);
void append(FITKAbstractDict* value);
/**
* @brief
* @param[i] index
* @param[i] value
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
void insert(int index, FITKAbstractDict::DictType value);
void insert(int index, bool value);
void insert(int index, double value);
void insert(int index, int value);
void insert(int index, const QString &value);
void insert(int index, const char *value);
void insert(int index, FITKAbstractDict* value);
/**
* @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{};
/**
* @brief
* @author liuzhonghua (liuzhonghuaszch@163.com)
* @date 2024-07-16
*/
ParenthesesType m_parentheses{ ParenthesesType::SmallParentheses };
};
}
#endif