From f76e76cbe666038d58d4de8ab9106360e16da6b1 Mon Sep 17 00:00:00 2001 From: castano Date: Thu, 17 Jan 2008 05:32:50 +0000 Subject: [PATCH] Export basic classes instead of exporting only their methods. --- src/nvcore/StdStream.h | 10 +++--- src/nvcore/StrLib.h | 74 ++++++++++++++++++++---------------------- src/nvcore/Stream.h | 2 +- src/nvimage/Image.h | 37 +++++++++++---------- src/nvmath/Color.h | 8 ++--- 5 files changed, 65 insertions(+), 66 deletions(-) diff --git a/src/nvcore/StdStream.h b/src/nvcore/StdStream.h index f10629b..3d764a3 100644 --- a/src/nvcore/StdStream.h +++ b/src/nvcore/StdStream.h @@ -27,7 +27,7 @@ inline FILE * fileOpen(const char * fileName, const char * mode) /// Base stdio stream. -class StdStream : public Stream +class NVCORE_CLASS StdStream : public Stream { public: @@ -99,7 +99,7 @@ protected: /// Standard output stream. -class StdOutputStream : public StdStream +class NVCORE_CLASS StdOutputStream : public StdStream { public: @@ -137,7 +137,7 @@ public: /// Standard input stream. -class StdInputStream : public StdStream +class NVCORE_CLASS StdInputStream : public StdStream { public: @@ -175,7 +175,7 @@ public: /// Memory input stream. -class MemoryInputStream : public Stream +class NVCORE_CLASS MemoryInputStream : public Stream { public: @@ -254,7 +254,7 @@ private: /// Protected input stream. -class ProtectedStream : public Stream +class NVCORE_CLASS ProtectedStream : public Stream { public: diff --git a/src/nvcore/StrLib.h b/src/nvcore/StrLib.h index 47e66ea..95d5cf4 100644 --- a/src/nvcore/StrLib.h +++ b/src/nvcore/StrLib.h @@ -39,39 +39,39 @@ namespace nv /// String builder. - class StringBuilder + class NVCORE_CLASS StringBuilder { public: - NVCORE_API StringBuilder(); - NVCORE_API explicit StringBuilder( int size_hint ); - NVCORE_API StringBuilder( const char * str ); - NVCORE_API StringBuilder( const StringBuilder & ); - NVCORE_API StringBuilder( int size_hint, const StringBuilder & ); - NVCORE_API StringBuilder( const char * format, ... ) __attribute__((format (printf, 2, 3))); - NVCORE_API StringBuilder( int size_hint, const char * format, ... ) __attribute__((format (printf, 3, 4))); + StringBuilder(); + explicit StringBuilder( int size_hint ); + StringBuilder( const char * str ); + StringBuilder( const StringBuilder & ); + StringBuilder( int size_hint, const StringBuilder & ); + StringBuilder( const char * format, ... ) __attribute__((format (printf, 2, 3))); + StringBuilder( int size_hint, const char * format, ... ) __attribute__((format (printf, 3, 4))); - NVCORE_API ~StringBuilder(); + ~StringBuilder(); - NVCORE_API StringBuilder & format( const char * format, ... ) __attribute__((format (printf, 2, 3))); - NVCORE_API StringBuilder & format( const char * format, va_list arg ); + StringBuilder & format( const char * format, ... ) __attribute__((format (printf, 2, 3))); + StringBuilder & format( const char * format, va_list arg ); - NVCORE_API StringBuilder & append( const char * str ); - NVCORE_API StringBuilder & appendFormat( const char * format, ... ) __attribute__((format (printf, 2, 3))); - NVCORE_API StringBuilder & appendFormat( const char * format, va_list arg ); + StringBuilder & append( const char * str ); + StringBuilder & appendFormat( const char * format, ... ) __attribute__((format (printf, 2, 3))); + StringBuilder & appendFormat( const char * format, va_list arg ); - NVCORE_API StringBuilder & number( int i, int base = 10 ); - NVCORE_API StringBuilder & number( uint i, int base = 10 ); + StringBuilder & number( int i, int base = 10 ); + StringBuilder & number( uint i, int base = 10 ); - NVCORE_API StringBuilder & reserve( uint size_hint ); - NVCORE_API StringBuilder & copy( const char * str ); - NVCORE_API StringBuilder & copy( const StringBuilder & str ); + StringBuilder & reserve( uint size_hint ); + StringBuilder & copy( const char * str ); + StringBuilder & copy( const StringBuilder & str ); - NVCORE_API StringBuilder & toLower(); - NVCORE_API StringBuilder & toUpper(); + StringBuilder & toLower(); + StringBuilder & toUpper(); - NVCORE_API void reset(); - NVCORE_API bool isNull() const { return m_size == 0; } + void reset(); + bool isNull() const { return m_size == 0; } // const char * accessors operator const char * () const { return m_str; } @@ -123,35 +123,33 @@ namespace nv /// Path string. - class Path : public StringBuilder + class NVCORE_CLASS Path : public StringBuilder { public: Path() : StringBuilder() {} explicit Path(int size_hint) : StringBuilder(size_hint) {} Path(const StringBuilder & str) : StringBuilder(str) {} Path(int size_hint, const StringBuilder & str) : StringBuilder(size_hint, str) {} - NVCORE_API Path(const char * format, ...) __attribute__((format (printf, 2, 3))); - NVCORE_API Path(int size_hint, const char * format, ...) __attribute__((format (printf, 3, 4))); + Path(const char * format, ...) __attribute__((format (printf, 2, 3))); + Path(int size_hint, const char * format, ...) __attribute__((format (printf, 3, 4))); + const char * fileName() const; + const char * extension() const; - NVCORE_API const char * fileName() const; - NVCORE_API const char * extension() const; + void translatePath(); - NVCORE_API void translatePath(); - - NVCORE_API void stripFileName(); - NVCORE_API void stripExtension(); + void stripFileName(); + void stripExtension(); // statics NVCORE_API static char separator(); NVCORE_API static const char * fileName(const char *); NVCORE_API static const char * extension(const char *); - }; /// String class. - class String + class NVCORE_CLASS String { public: @@ -194,7 +192,7 @@ namespace nv release(); } - NVCORE_API String clone() const; + String clone() const; /// Release the current string and allocate a new one. const String & operator=( const char * str ) @@ -334,9 +332,9 @@ namespace nv const_cast(data)[len] = '\0'; } - NVCORE_API void setString(const char * str); - NVCORE_API void setString(const char * str, int length); - NVCORE_API void setString(const StringBuilder & str); + void setString(const char * str); + void setString(const char * str, int length); + void setString(const StringBuilder & str); /// Swap strings. friend void swap(String & a, String & b) { diff --git a/src/nvcore/Stream.h b/src/nvcore/Stream.h index 7d28607..ec18717 100644 --- a/src/nvcore/Stream.h +++ b/src/nvcore/Stream.h @@ -10,7 +10,7 @@ namespace nv { /// Base stream class. -class Stream { +class NVCORE_CLASS Stream { public: enum ByteOrder { diff --git a/src/nvimage/Image.h b/src/nvimage/Image.h index d5b0a1b..9dd11b4 100644 --- a/src/nvimage/Image.h +++ b/src/nvimage/Image.h @@ -11,8 +11,9 @@ namespace nv class Color32; /// 32 bit RGBA image. - class Image + class NVIMAGE_CLASS Image { + NV_FORBID_COPY(Image); public: enum Format @@ -21,34 +22,34 @@ namespace nv Format_ARGB, }; - NVIMAGE_API Image(); - NVIMAGE_API ~Image(); + Image(); + ~Image(); - NVIMAGE_API void allocate(uint w, uint h); - NVIMAGE_API bool load(const char * name); + void allocate(uint w, uint h); + bool load(const char * name); - NVIMAGE_API void wrap(void * data, uint w, uint h); - NVIMAGE_API void unwrap(); + void wrap(void * data, uint w, uint h); + void unwrap(); - NVIMAGE_API uint width() const; - NVIMAGE_API uint height() const; + uint width() const; + uint height() const; - NVIMAGE_API const Color32 * scanline(uint h) const; - NVIMAGE_API Color32 * scanline(uint h); + const Color32 * scanline(uint h) const; + Color32 * scanline(uint h); - NVIMAGE_API const Color32 * pixels() const; - NVIMAGE_API Color32 * pixels(); + const Color32 * pixels() const; + Color32 * pixels(); - NVIMAGE_API const Color32 & pixel(uint idx) const; - NVIMAGE_API Color32 & pixel(uint idx); + const Color32 & pixel(uint idx) const; + Color32 & pixel(uint idx); const Color32 & pixel(uint x, uint y) const; Color32 & pixel(uint x, uint y); - NVIMAGE_API Format format() const; - NVIMAGE_API void setFormat(Format f); + Format format() const; + void setFormat(Format f); - NVIMAGE_API void fill(Color32 c); + void fill(Color32 c); private: void free(); diff --git a/src/nvmath/Color.h b/src/nvmath/Color.h index 6791975..b6d548b 100644 --- a/src/nvmath/Color.h +++ b/src/nvmath/Color.h @@ -10,7 +10,7 @@ namespace nv { /// 64 bit color stored as BGRA. -class Color64 +class NVMATH_CLASS Color64 { public: Color64() { } @@ -33,7 +33,7 @@ public: union { struct { #if NV_LITTLE_ENDIAN - uint16 b, g, r, a; + uint16 r, a, b, g; #else uint16 a: 16; uint16 r: 16; @@ -46,7 +46,7 @@ public: }; /// 32 bit color stored as BGRA. -class Color32 +class NVMATH_CLASS Color32 { public: Color32() { } @@ -95,7 +95,7 @@ public: /// 16 bit 565 BGR color. -class Color16 +class NVMATH_CLASS Color16 { public: Color16() { }