Commit 36bbe25f authored by Ghislain MARY's avatar Ghislain MARY

Export some symbols for build with Visual Studio.

parent c30f1e94
......@@ -19,6 +19,12 @@
#ifndef belcard_hpp
#define belcard_hpp
#if defined(_MSC_VER)
#define BELCARD_PUBLIC __declspec(dllexport)
#else
#define BELCARD_PUBLIC
#endif
#include "belcard_generic.hpp"
#include "belcard_params.hpp"
#include "belcard_property.hpp"
......@@ -88,13 +94,13 @@ namespace belcard {
public:
static void setHandlerAndCollectors(Parser<shared_ptr<BelCardGeneric>> *parser);
BelCard();
BELCARD_PUBLIC BelCard();
void setKind(const shared_ptr<BelCardKind> &kind);
const shared_ptr<BelCardKind> &getKind() const;
void setFullName(const shared_ptr<BelCardFullName> &fn);
const shared_ptr<BelCardFullName> &getFullName() const;
BELCARD_PUBLIC void setFullName(const shared_ptr<BelCardFullName> &fn);
BELCARD_PUBLIC const shared_ptr<BelCardFullName> &getFullName() const;
void setName(const shared_ptr<BelCardName> &n);
const shared_ptr<BelCardName> &getName() const;
......@@ -146,9 +152,9 @@ namespace belcard {
void removeEmail(const shared_ptr<BelCardEmail> &email);
const list<shared_ptr<BelCardEmail>> &getEmails() const;
void addImpp(const shared_ptr<BelCardImpp> &impp);
void removeImpp(const shared_ptr<BelCardImpp> &impp);
const list<shared_ptr<BelCardImpp>> &getImpp() const;
BELCARD_PUBLIC void addImpp(const shared_ptr<BelCardImpp> &impp);
BELCARD_PUBLIC void removeImpp(const shared_ptr<BelCardImpp> &impp);
BELCARD_PUBLIC const list<shared_ptr<BelCardImpp>> &getImpp() const;
void addLang(const shared_ptr<BelCardLang> &lang);
void removeLang(const shared_ptr<BelCardLang> &lang);
......@@ -238,7 +244,7 @@ namespace belcard {
void removeProperty(const shared_ptr<BelCardProperty> &property);
const list<shared_ptr<BelCardProperty>> &getProperties() const;
string& toFoldedString();
BELCARD_PUBLIC string& toFoldedString();
bool assertRFCCompliance() const;
virtual void serialize(ostream &output) const;
......@@ -254,7 +260,7 @@ namespace belcard {
BelCardList();
void addCard(const shared_ptr<BelCard> &vcard);
const list<shared_ptr<BelCard>> &getCards() const;
BELCARD_PUBLIC const list<shared_ptr<BelCard>> &getCards() const;
void serialize(ostream &output) const;
};
......
......@@ -51,7 +51,7 @@ namespace belcard {
static shared_ptr<BelCardImpp> parse(const string& input) ;
static void setHandlerAndCollectors(Parser<shared_ptr<BelCardGeneric>> *parser);
BelCardImpp();
BELCARD_PUBLIC BelCardImpp();
};
class BelCardLang : public BelCardProperty {
......
......@@ -36,7 +36,7 @@ namespace belcard {
static shared_ptr<BelCardFullName> parse(const string& input);
static void setHandlerAndCollectors(Parser<shared_ptr<BelCardGeneric>> *parser);
BelCardFullName();
BELCARD_PUBLIC BelCardFullName();
};
class BelCardName : public BelCardProperty {
......
......@@ -37,16 +37,13 @@ namespace belcard {
shared_ptr<BelCardGeneric> _parse(const string &input, const string &rule);
public:
static BelCardParser& getInstance() {
static BelCardParser *instance = new BelCardParser();
return *instance;
}
BELCARD_PUBLIC static BelCardParser& getInstance();
~BelCardParser();
BELCARD_PUBLIC ~BelCardParser();
shared_ptr<BelCard> parseOne(const string &input);
shared_ptr<BelCardList> parse(const string &input);
shared_ptr<BelCardList> parseFile(const string &filename);
BELCARD_PUBLIC shared_ptr<BelCard> parseOne(const string &input);
BELCARD_PUBLIC shared_ptr<BelCardList> parse(const string &input);
BELCARD_PUBLIC shared_ptr<BelCardList> parseFile(const string &filename);
};
}
......
......@@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "belcard/belcard_communication.hpp"
#include "belcard/belcard.hpp"
using namespace::std;
using namespace::belr;
......
......@@ -16,7 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "belcard/belcard_identification.hpp"
#include "belcard/belcard.hpp"
using namespace::std;
using namespace::belr;
......
......@@ -125,4 +125,9 @@ shared_ptr<BelCardList> BelCardParser::parseFile(const string &filename) {
shared_ptr<BelCardGeneric> ret = _parse(vcards, "vcard-list");
shared_ptr<BelCardList> belCards = dynamic_pointer_cast<BelCardList>(ret);
return belCards;
}
\ No newline at end of file
}
BelCardParser& BelCardParser::getInstance() {
static BelCardParser *instance = new BelCardParser();
return *instance;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment