tahoma2d/toonz/sources/include/tdata.h

77 lines
1.5 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef T_DATA_INCLUDED
#define T_DATA_INCLUDED
#include "tsmartpointer.h"
#include "tfilepath.h"
#undef DVAPI
#undef DVVAR
#ifdef TNZCORE_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
//-------------------------------------------------------------------
class TData;
2016-04-15 17:11:23 +12:00
#ifdef _WIN32
2016-03-19 06:57:51 +13:00
template class DVAPI TSmartPointerT<TData>;
#endif
typedef TSmartPointerT<TData> TDataP;
//-------------------------------------------------------------------
2016-06-15 18:43:10 +12:00
class DVAPI TData : public TSmartObject {
DECLARE_CLASS_CODE
2016-03-19 06:57:51 +13:00
protected:
2016-06-15 18:43:10 +12:00
TData() : TSmartObject(m_classCode) {}
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
virtual TDataP clone() const = 0;
2016-03-19 06:57:51 +13:00
};
//-------------------------------------------------------------------
class DVAPI TTextData final : public TData {
2016-06-15 18:43:10 +12:00
TString m_text;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TTextData(TString text) : m_text(text) {}
TTextData(std::string text);
2016-03-19 06:57:51 +13:00
2016-06-19 20:06:29 +12:00
TDataP clone() const override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
TString getText() const { return m_text; }
2016-03-19 06:57:51 +13:00
};
//-------------------------------------------------------------------
#ifdef _MSC_VER
2016-03-19 06:57:51 +13:00
#pragma warning(push)
#pragma warning(disable : 4251)
#endif
class DVAPI TFilePathListData final : public TData {
2016-06-15 18:43:10 +12:00
std::vector<TFilePath> m_filePaths;
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
TFilePathListData(const std::vector<TFilePath> &filePaths)
: m_filePaths(filePaths) {}
2016-06-19 20:06:29 +12:00
TDataP clone() const override;
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
int getFilePathCount() const { return m_filePaths.size(); }
TFilePath getFilePath(int i) const;
2016-03-19 06:57:51 +13:00
};
#ifdef _MSC_VER
2016-03-19 06:57:51 +13:00
#pragma warning(pop)
#endif
#endif