summaryrefslogtreecommitdiff
path: root/Ivy/DataTypes.h
diff options
context:
space:
mode:
authorfcolin2007-02-01 12:54:14 +0000
committerfcolin2007-02-01 12:54:14 +0000
commitdc8fec9b2b2d00be9751afde91a14d2a841039f4 (patch)
tree5e71308f46c381fa8a2cd7714a277bcd378d24b2 /Ivy/DataTypes.h
parent87abbc06c1146ff80457407150c4e212b4ed4916 (diff)
downloadivy-cplusplus-dc8fec9b2b2d00be9751afde91a14d2a841039f4.zip
ivy-cplusplus-dc8fec9b2b2d00be9751afde91a14d2a841039f4.tar.gz
ivy-cplusplus-dc8fec9b2b2d00be9751afde91a14d2a841039f4.tar.bz2
ivy-cplusplus-dc8fec9b2b2d00be9751afde91a14d2a841039f4.tar.xz
Utilisateur : Fcolin Date : 31/01/01 Heure : 11:18 Archivé dans $/Ivy (vss 2)
Diffstat (limited to 'Ivy/DataTypes.h')
-rw-r--r--Ivy/DataTypes.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/Ivy/DataTypes.h b/Ivy/DataTypes.h
index e69de29..53bef2b 100644
--- a/Ivy/DataTypes.h
+++ b/Ivy/DataTypes.h
@@ -0,0 +1,81 @@
+#pragma once
+
+#ifdef WIN32
+#ifdef IVY_EXPORTS
+class _declspec(dllexport) string;
+#else
+#pragma comment(lib,"Ivy.LIB" )
+class _declspec(dllimport) string;
+#endif
+#endif
+
+class string {
+public:
+ string();
+ string( const char * s);
+ int length();
+ bool empty();
+ void erase(int start=0, int len = -1);
+ void append( const char *s , int len );
+ void insert(int index, const char * s);
+ string substr( int start, int len = -1 );
+ int find_first_of( const char* s );
+ int rfind( char c );
+ operator +=(string s);
+ string operator +(string s);
+ // Nondestructive typecast operator
+ operator const char*() const;
+ const char *c_str() const; // remove this ugly thing
+};
+
+template <class T> class Iterator {
+public:
+ T & operator !=(Iterator i);
+ T & operator ++();
+ operator const T*() const;
+ T & second;
+
+};
+
+
+template <class T> class list {
+public:
+ void clear();
+ bool empty();
+ T front();
+ pop_front();
+ void push_back( T data );
+ typedef Iterator<T> iterator;
+ iterator begin();
+ iterator end();
+ void remove( T data );
+};
+
+template <class T> class vector {
+public:
+ void clear();
+ int size();
+ // Nondestructive typecast operator
+ operator const T*() const;
+ // Accesses indexed component of vector
+ T & operator [](int i);
+ // Accesses indexed component of vector
+ const T & operator [](int i) const;
+ void push_back( T data );
+ void remove( T data );
+
+};
+
+template <class I, class T> class map {
+public:
+ void clear();
+ int size();
+ bool empty();
+ find(I i );
+ typedef Iterator<T> iterator;
+ iterator begin();
+ iterator end();
+ void erase( I i );
+ // Accesses indexed component of vector
+ const T & operator [](I i) const;
+}; \ No newline at end of file