tahoma2d/toonz/sources/include/tdata.h

80 lines
1.5 KiB
C
Raw Normal View History

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;
//-------------------------------------------------------------------
class DVAPI TData : public TSmartObject
{
DECLARE_CLASS_CODE
protected:
TData() : TSmartObject(m_classCode) {}
public:
virtual TDataP clone() const = 0;
};
//-------------------------------------------------------------------
class DVAPI TTextData : public TData
{
TString m_text;
public:
TTextData(TString text) : m_text(text) {}
TTextData(std::string text);
2016-03-19 06:57:51 +13:00
TDataP clone() const;
TString getText() const { return m_text; }
};
//-------------------------------------------------------------------
2016-04-15 17:11:23 +12:00
#ifdef _WIN32
2016-03-19 06:57:51 +13:00
#pragma warning(push)
#pragma warning(disable : 4251)
#endif
class DVAPI TFilePathListData : public TData
{
std::vector<TFilePath> m_filePaths;
2016-03-19 06:57:51 +13:00
public:
TFilePathListData(const std::vector<TFilePath> &filePaths) : m_filePaths(filePaths) {}
2016-03-19 06:57:51 +13:00
TDataP clone() const;
int getFilePathCount() const { return m_filePaths.size(); }
TFilePath getFilePath(int i) const;
};
2016-04-15 17:11:23 +12:00
#ifdef _WIN32
2016-03-19 06:57:51 +13:00
#pragma warning(pop)
#endif
#endif