summaryrefslogtreecommitdiff
path: root/Ivy/DataTypes.h
blob: 53bef2b61ce64f67f56a720bebb4199d38369b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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;
};