Export basic classes instead of exporting only their methods.

This commit is contained in:
castano 2008-01-17 05:32:50 +00:00
parent 7bf3927635
commit f76e76cbe6
5 changed files with 65 additions and 66 deletions

View File

@ -27,7 +27,7 @@ inline FILE * fileOpen(const char * fileName, const char * mode)
/// Base stdio stream. /// Base stdio stream.
class StdStream : public Stream class NVCORE_CLASS StdStream : public Stream
{ {
public: public:
@ -99,7 +99,7 @@ protected:
/// Standard output stream. /// Standard output stream.
class StdOutputStream : public StdStream class NVCORE_CLASS StdOutputStream : public StdStream
{ {
public: public:
@ -137,7 +137,7 @@ public:
/// Standard input stream. /// Standard input stream.
class StdInputStream : public StdStream class NVCORE_CLASS StdInputStream : public StdStream
{ {
public: public:
@ -175,7 +175,7 @@ public:
/// Memory input stream. /// Memory input stream.
class MemoryInputStream : public Stream class NVCORE_CLASS MemoryInputStream : public Stream
{ {
public: public:
@ -254,7 +254,7 @@ private:
/// Protected input stream. /// Protected input stream.
class ProtectedStream : public Stream class NVCORE_CLASS ProtectedStream : public Stream
{ {
public: public:

View File

@ -39,39 +39,39 @@ namespace nv
/// String builder. /// String builder.
class StringBuilder class NVCORE_CLASS StringBuilder
{ {
public: public:
NVCORE_API StringBuilder(); StringBuilder();
NVCORE_API explicit StringBuilder( int size_hint ); explicit StringBuilder( int size_hint );
NVCORE_API StringBuilder( const char * str ); StringBuilder( const char * str );
NVCORE_API StringBuilder( const StringBuilder & ); StringBuilder( const StringBuilder & );
NVCORE_API StringBuilder( int size_hint, const StringBuilder & ); StringBuilder( int size_hint, const StringBuilder & );
NVCORE_API StringBuilder( const char * format, ... ) __attribute__((format (printf, 2, 3))); StringBuilder( const char * format, ... ) __attribute__((format (printf, 2, 3)));
NVCORE_API StringBuilder( int size_hint, const char * format, ... ) __attribute__((format (printf, 3, 4))); 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))); 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, va_list arg );
NVCORE_API StringBuilder & append( const char * str ); StringBuilder & append( const char * str );
NVCORE_API StringBuilder & appendFormat( const char * format, ... ) __attribute__((format (printf, 2, 3))); StringBuilder & appendFormat( const char * format, ... ) __attribute__((format (printf, 2, 3)));
NVCORE_API StringBuilder & appendFormat( const char * format, va_list arg ); StringBuilder & appendFormat( const char * format, va_list arg );
NVCORE_API StringBuilder & number( int i, int base = 10 ); StringBuilder & number( int i, int base = 10 );
NVCORE_API StringBuilder & number( uint i, int base = 10 ); StringBuilder & number( uint i, int base = 10 );
NVCORE_API StringBuilder & reserve( uint size_hint ); StringBuilder & reserve( uint size_hint );
NVCORE_API StringBuilder & copy( const char * str ); StringBuilder & copy( const char * str );
NVCORE_API StringBuilder & copy( const StringBuilder & str ); StringBuilder & copy( const StringBuilder & str );
NVCORE_API StringBuilder & toLower(); StringBuilder & toLower();
NVCORE_API StringBuilder & toUpper(); StringBuilder & toUpper();
NVCORE_API void reset(); void reset();
NVCORE_API bool isNull() const { return m_size == 0; } bool isNull() const { return m_size == 0; }
// const char * accessors // const char * accessors
operator const char * () const { return m_str; } operator const char * () const { return m_str; }
@ -123,35 +123,33 @@ namespace nv
/// Path string. /// Path string.
class Path : public StringBuilder class NVCORE_CLASS Path : public StringBuilder
{ {
public: public:
Path() : StringBuilder() {} Path() : StringBuilder() {}
explicit Path(int size_hint) : StringBuilder(size_hint) {} explicit Path(int size_hint) : StringBuilder(size_hint) {}
Path(const StringBuilder & str) : StringBuilder(str) {} Path(const StringBuilder & str) : StringBuilder(str) {}
Path(int size_hint, const StringBuilder & str) : StringBuilder(size_hint, str) {} Path(int size_hint, const StringBuilder & str) : StringBuilder(size_hint, str) {}
NVCORE_API Path(const char * format, ...) __attribute__((format (printf, 2, 3))); Path(const char * format, ...) __attribute__((format (printf, 2, 3)));
NVCORE_API Path(int size_hint, const char * format, ...) __attribute__((format (printf, 3, 4))); 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; void translatePath();
NVCORE_API const char * extension() const;
NVCORE_API void translatePath(); void stripFileName();
void stripExtension();
NVCORE_API void stripFileName();
NVCORE_API void stripExtension();
// statics // statics
NVCORE_API static char separator(); NVCORE_API static char separator();
NVCORE_API static const char * fileName(const char *); NVCORE_API static const char * fileName(const char *);
NVCORE_API static const char * extension(const char *); NVCORE_API static const char * extension(const char *);
}; };
/// String class. /// String class.
class String class NVCORE_CLASS String
{ {
public: public:
@ -194,7 +192,7 @@ namespace nv
release(); release();
} }
NVCORE_API String clone() const; String clone() const;
/// Release the current string and allocate a new one. /// Release the current string and allocate a new one.
const String & operator=( const char * str ) const String & operator=( const char * str )
@ -334,9 +332,9 @@ namespace nv
const_cast<char *>(data)[len] = '\0'; const_cast<char *>(data)[len] = '\0';
} }
NVCORE_API void setString(const char * str); void setString(const char * str);
NVCORE_API void setString(const char * str, int length); void setString(const char * str, int length);
NVCORE_API void setString(const StringBuilder & str); void setString(const StringBuilder & str);
/// Swap strings. /// Swap strings.
friend void swap(String & a, String & b) { friend void swap(String & a, String & b) {

View File

@ -10,7 +10,7 @@ namespace nv
{ {
/// Base stream class. /// Base stream class.
class Stream { class NVCORE_CLASS Stream {
public: public:
enum ByteOrder { enum ByteOrder {

View File

@ -11,8 +11,9 @@ namespace nv
class Color32; class Color32;
/// 32 bit RGBA image. /// 32 bit RGBA image.
class Image class NVIMAGE_CLASS Image
{ {
NV_FORBID_COPY(Image);
public: public:
enum Format enum Format
@ -21,34 +22,34 @@ namespace nv
Format_ARGB, Format_ARGB,
}; };
NVIMAGE_API Image(); Image();
NVIMAGE_API ~Image(); ~Image();
NVIMAGE_API void allocate(uint w, uint h); void allocate(uint w, uint h);
NVIMAGE_API bool load(const char * name); bool load(const char * name);
NVIMAGE_API void wrap(void * data, uint w, uint h); void wrap(void * data, uint w, uint h);
NVIMAGE_API void unwrap(); void unwrap();
NVIMAGE_API uint width() const; uint width() const;
NVIMAGE_API uint height() const; uint height() const;
NVIMAGE_API const Color32 * scanline(uint h) const; const Color32 * scanline(uint h) const;
NVIMAGE_API Color32 * scanline(uint h); Color32 * scanline(uint h);
NVIMAGE_API const Color32 * pixels() const; const Color32 * pixels() const;
NVIMAGE_API Color32 * pixels(); Color32 * pixels();
NVIMAGE_API const Color32 & pixel(uint idx) const; const Color32 & pixel(uint idx) const;
NVIMAGE_API Color32 & pixel(uint idx); Color32 & pixel(uint idx);
const Color32 & pixel(uint x, uint y) const; const Color32 & pixel(uint x, uint y) const;
Color32 & pixel(uint x, uint y); Color32 & pixel(uint x, uint y);
NVIMAGE_API Format format() const; Format format() const;
NVIMAGE_API void setFormat(Format f); void setFormat(Format f);
NVIMAGE_API void fill(Color32 c); void fill(Color32 c);
private: private:
void free(); void free();

View File

@ -10,7 +10,7 @@ namespace nv
{ {
/// 64 bit color stored as BGRA. /// 64 bit color stored as BGRA.
class Color64 class NVMATH_CLASS Color64
{ {
public: public:
Color64() { } Color64() { }
@ -33,7 +33,7 @@ public:
union { union {
struct { struct {
#if NV_LITTLE_ENDIAN #if NV_LITTLE_ENDIAN
uint16 b, g, r, a; uint16 r, a, b, g;
#else #else
uint16 a: 16; uint16 a: 16;
uint16 r: 16; uint16 r: 16;
@ -46,7 +46,7 @@ public:
}; };
/// 32 bit color stored as BGRA. /// 32 bit color stored as BGRA.
class Color32 class NVMATH_CLASS Color32
{ {
public: public:
Color32() { } Color32() { }
@ -95,7 +95,7 @@ public:
/// 16 bit 565 BGR color. /// 16 bit 565 BGR color.
class Color16 class NVMATH_CLASS Color16
{ {
public: public:
Color16() { } Color16() { }