#define MSP_DATAFILE_BUILTINSOURCE_H_
#include "collectionsource.h"
+#include "mspdatafile_api.h"
namespace Msp {
namespace DataFile {
-class BuiltinSource: public CollectionSource
+class MSPDATAFILE_API BuiltinSource: public CollectionSource
{
private:
struct Object
#include "collectionsource.h"
#include "loader.h"
#include "meta.h"
+#include "mspdatafile_api.h"
/* XXX This file is a big mess with too many things in it. However, the
dependencies between those things make it difficult to split up. */
between the collections, and are only deleted when all collections in the chain
have been destroyed.
*/
-class Collection: private NonCopyable
+class MSPDATAFILE_API Collection: private NonCopyable
{
public:
/**
#include <list>
#include <string>
#include <msp/io/seekable.h>
+#include "mspdatafile_api.h"
namespace Msp {
namespace DataFile {
Provides automatically loadable objects for collections. This is a base class;
see DirectorySource and PackSource for concrete classes.
*/
-class CollectionSource
+class MSPDATAFILE_API CollectionSource
{
public:
typedef std::list<std::string> NameList;
#include <msp/fs/path.h>
#include "collectionsource.h"
+#include "mspdatafile_api.h"
namespace Msp {
namespace DataFile {
/**
A source that load items from files in a directory.
*/
-class DirectorySource: public CollectionSource
+class MSPDATAFILE_API DirectorySource: public CollectionSource
{
private:
typedef std::map<std::string, FS::Path> ObjectMap;
#include <stdexcept>
#include <string>
#include <typeinfo>
+#include "mspdatafile_api.h"
namespace Msp {
namespace DataFile {
-class data_error: public std::runtime_error
+class MSPDATAFILE_API data_error: public std::runtime_error
{
private:
std::string source;
};
-class parse_error: public std::runtime_error
+class MSPDATAFILE_API parse_error: public std::runtime_error
{
public:
parse_error(const std::string &);
};
-class syntax_error: public std::runtime_error
+class MSPDATAFILE_API syntax_error: public std::runtime_error
{
public:
syntax_error(const std::string &t);
};
-class bad_definition: public std::runtime_error
+class MSPDATAFILE_API bad_definition: public std::runtime_error
{
public:
bad_definition(const std::string &w);
};
-class nesting_error: public std::logic_error
+class MSPDATAFILE_API nesting_error: public std::logic_error
{
public:
nesting_error(const std::string &);
};
-class unknown_keyword: public std::runtime_error
+class MSPDATAFILE_API unknown_keyword: public std::runtime_error
{
public:
unknown_keyword(const std::string &);
};
-class invalid_signature: public std::runtime_error
+class MSPDATAFILE_API invalid_signature: public std::runtime_error
{
public:
invalid_signature(const std::string &, const std::string &);
};
-class no_collection: public std::runtime_error
+class MSPDATAFILE_API no_collection: public std::runtime_error
{
public:
no_collection(const std::type_info &);
#include <msp/io/file.h>
#include "loaderaction.h"
#include "meta.h"
+#include "mspdatafile_api.h"
#include "parser.h"
#include "statement.h"
See also classes ObjectLoader and CollectionObjectLoader in objectloader.h.
*/
-class Loader: private NonCopyable
+class MSPDATAFILE_API Loader: private NonCopyable
{
protected:
- class ActionMap: public std::map<StatementKey, LoaderAction *>, private NonCopyable
+ class MSPDATAFILE_API ActionMap: public std::map<StatementKey, LoaderAction *>, private NonCopyable
{
public:
~ActionMap();
--- /dev/null
+#ifndef MSP_DATAFILE_API_H_
+#define MSP_DATAFILE_API_H_
+
+#if defined(_WIN32)
+#if defined(MSPDATAFILE_BUILD)
+#define MSPDATAFILE_API __declspec(dllexport)
+#elif defined(MSPDATAFILE_IMPORT)
+#define MSPDATAFILE_API __declspec(dllimport)
+#else
+#define MSPDATAFILE_API
+#endif
+#elif defined(__GNUC__)
+#define MSPDATAFILE_API __attribute__((visibility("default")))
+#else
+#define MSPDATAFILE_API
+#endif
+
+#endif
#include <msp/core/noncopyable.h>
#include <msp/core/refptr.h>
#include "collectionsource.h"
+#include "mspdatafile_api.h"
#include "objectloader.h"
namespace Msp {
an object from such a file is requested, the entire sub-collection it is stored
in is loaded.
*/
-class PackSource: public CollectionSource
+class MSPDATAFILE_API PackSource: public CollectionSource
{
public:
struct FileInfo
#include <string>
#include <msp/core/noncopyable.h>
#include "input.h"
+#include "mspdatafile_api.h"
namespace Msp {
namespace DataFile {
formats. A Parser evaluates into a boolean value indicating whether more
statements may be read.
*/
-class Parser: private NonCopyable
+class MSPDATAFILE_API Parser: private NonCopyable
{
private:
Input in;
#include <string>
#include <msp/core/noncopyable.h>
#include <msp/io/base.h>
+#include "mspdatafile_api.h"
namespace Msp {
namespace DataFile {
class Collection;
-class RawData: public NonCopyable
+class MSPDATAFILE_API RawData: public NonCopyable
{
private:
enum Flags
#define MSP_DATAFILE_STATEMENT_H_
#include <list>
+#include "mspdatafile_api.h"
#include "value.h"
namespace Msp {
struct Token;
-struct Statement
+struct MSPDATAFILE_API Statement
{
typedef std::vector<Value> Arguments;
#include <map>
#include <msp/core/noncopyable.h>
#include <msp/io/base.h>
+#include "mspdatafile_api.h"
#include "output.h"
namespace Msp {
/**
Frontend for writing data.
*/
-class Writer: private NonCopyable
+class MSPDATAFILE_API Writer: private NonCopyable
{
private:
Output out;