]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/lexicalcast.h
Add decorations for things which are considered part of the API
[libs/core.git] / source / strings / lexicalcast.h
index 12b5d08a1c9e3689f8ada501bc63a33931c9052d..ccb77909893091c4a929bbd51772ab5ef9046682 100644 (file)
@@ -5,6 +5,7 @@
 #include <string>
 #include <stdexcept>
 #include <msp/core/meta.h>
+#include <msp/core/mspcore_api.h>
 #include "fmt.h"
 
 namespace Msp {
@@ -12,7 +13,7 @@ namespace Msp {
 /**
 Thrown for errors in lexical conversions.
 */
-class lexical_error: public std::runtime_error
+class MSPCORE_API lexical_error: public std::runtime_error
 {
 public:
        lexical_error(const std::string &w): runtime_error(w) { }
@@ -22,7 +23,7 @@ public:
 /**
 Thrown when the format is unsuitable for the type being converted.
 */
-class format_mismatch: public lexical_error
+class MSPCORE_API format_mismatch: public lexical_error
 {
 public:
        format_mismatch(const std::string &w): lexical_error(w) { }
@@ -32,7 +33,7 @@ public:
 /**
 Helper class for lexical_cast to facilitate operator overloading.
 */
-class LexicalConverter
+class MSPCORE_API LexicalConverter
 {
 private:
        Fmt fmt;
@@ -49,41 +50,41 @@ public:
 };
 
 
-void operator<<(LexicalConverter &, char);
-void operator<<(LexicalConverter &, signed char);
-void operator<<(LexicalConverter &, short);
-void operator<<(LexicalConverter &, int);
-void operator<<(LexicalConverter &, long);
-void operator<<(LexicalConverter &, unsigned char);
-void operator<<(LexicalConverter &, unsigned short);
-void operator<<(LexicalConverter &, unsigned);
-void operator<<(LexicalConverter &, unsigned long);
-void operator<<(LexicalConverter &, long long);
-void operator<<(LexicalConverter &, unsigned long long);
-void operator<<(LexicalConverter &, bool);
-void operator<<(LexicalConverter &, float);
-void operator<<(LexicalConverter &, double);
-void operator<<(LexicalConverter &, long double);
-void operator<<(LexicalConverter &, const std::string &);
-void operator<<(LexicalConverter &, const char *);
-void operator<<(LexicalConverter &, const void *);
-
-void operator>>(const LexicalConverter &, char &);
-void operator>>(const LexicalConverter &, signed char &);
-void operator>>(const LexicalConverter &, short &);
-void operator>>(const LexicalConverter &, int &);
-void operator>>(const LexicalConverter &, long &);
-void operator>>(const LexicalConverter &, unsigned char &);
-void operator>>(const LexicalConverter &, unsigned short &);
-void operator>>(const LexicalConverter &, unsigned int &);
-void operator>>(const LexicalConverter &, unsigned long &);
-void operator>>(const LexicalConverter &, long long &);
-void operator>>(const LexicalConverter &, unsigned long long &);
-void operator>>(const LexicalConverter &, bool &);
-void operator>>(const LexicalConverter &, float &);
-void operator>>(const LexicalConverter &, double &);
-void operator>>(const LexicalConverter &, long double &);
-void operator>>(const LexicalConverter &, std::string &);
+MSPCORE_API void operator<<(LexicalConverter &, char);
+MSPCORE_API void operator<<(LexicalConverter &, signed char);
+MSPCORE_API void operator<<(LexicalConverter &, short);
+MSPCORE_API void operator<<(LexicalConverter &, int);
+MSPCORE_API void operator<<(LexicalConverter &, long);
+MSPCORE_API void operator<<(LexicalConverter &, unsigned char);
+MSPCORE_API void operator<<(LexicalConverter &, unsigned short);
+MSPCORE_API void operator<<(LexicalConverter &, unsigned);
+MSPCORE_API void operator<<(LexicalConverter &, unsigned long);
+MSPCORE_API void operator<<(LexicalConverter &, long long);
+MSPCORE_API void operator<<(LexicalConverter &, unsigned long long);
+MSPCORE_API void operator<<(LexicalConverter &, bool);
+MSPCORE_API void operator<<(LexicalConverter &, float);
+MSPCORE_API void operator<<(LexicalConverter &, double);
+MSPCORE_API void operator<<(LexicalConverter &, long double);
+MSPCORE_API void operator<<(LexicalConverter &, const std::string &);
+MSPCORE_API void operator<<(LexicalConverter &, const char *);
+MSPCORE_API void operator<<(LexicalConverter &, const void *);
+
+MSPCORE_API void operator>>(const LexicalConverter &, char &);
+MSPCORE_API void operator>>(const LexicalConverter &, signed char &);
+MSPCORE_API void operator>>(const LexicalConverter &, short &);
+MSPCORE_API void operator>>(const LexicalConverter &, int &);
+MSPCORE_API void operator>>(const LexicalConverter &, long &);
+MSPCORE_API void operator>>(const LexicalConverter &, unsigned char &);
+MSPCORE_API void operator>>(const LexicalConverter &, unsigned short &);
+MSPCORE_API void operator>>(const LexicalConverter &, unsigned int &);
+MSPCORE_API void operator>>(const LexicalConverter &, unsigned long &);
+MSPCORE_API void operator>>(const LexicalConverter &, long long &);
+MSPCORE_API void operator>>(const LexicalConverter &, unsigned long long &);
+MSPCORE_API void operator>>(const LexicalConverter &, bool &);
+MSPCORE_API void operator>>(const LexicalConverter &, float &);
+MSPCORE_API void operator>>(const LexicalConverter &, double &);
+MSPCORE_API void operator>>(const LexicalConverter &, long double &);
+MSPCORE_API void operator>>(const LexicalConverter &, std::string &);
 
 // Generic operators using stringstream