diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2011-06-03 07:18:23 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2011-06-03 07:18:23 +0000 |
| commit | f16f239688b632fc54684c3e0e1430fd89a67db5 (patch) | |
| tree | 6a6d4f3b5d5f4974af4c3cc47c7892e46c5ef201 /src/variable.h | |
| parent | 4f1e5849d4a48eb674d81164ba4baba4ad51a89f (diff) | |
| download | build-f16f239688b632fc54684c3e0e1430fd89a67db5.tar.gz build-f16f239688b632fc54684c3e0e1430fd89a67db5.tar.bz2 build-f16f239688b632fc54684c3e0e1430fd89a67db5.tar.xz build-f16f239688b632fc54684c3e0e1430fd89a67db5.zip | |
I added basic support for "opaque" type variables. I think there's one more
tweak to it that I would like to make, but it's fine for now. I also added
open, close, read, and write functions. They work just fine, but I'll also add
a readLine function, and maybe even a readToken function later.
Diffstat (limited to '')
| -rw-r--r-- | src/variable.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/variable.h b/src/variable.h index 260c96a..241393e 100644 --- a/src/variable.h +++ b/src/variable.h | |||
| @@ -21,7 +21,8 @@ public: | |||
| 21 | typeVersion, | 21 | typeVersion, |
| 22 | typeString, | 22 | typeString, |
| 23 | typeList, | 23 | typeList, |
| 24 | typeRef /**< Reference by name, it's just a string. */ | 24 | typeRef, /**< Reference by name, it's just a string. */ |
| 25 | typeOpaque /**< Only useful to functions. */ | ||
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| 27 | public: | 28 | public: |
| @@ -41,6 +42,7 @@ public: | |||
| 41 | */ | 42 | */ |
| 42 | Variable( const StrList &lst ); | 43 | Variable( const StrList &lst ); |
| 43 | Variable( const VarList &lst ); | 44 | Variable( const VarList &lst ); |
| 45 | Variable( void *oVal ); | ||
| 44 | virtual ~Variable(); | 46 | virtual ~Variable(); |
| 45 | 47 | ||
| 46 | static Variable mkRef( const Bu::String &sVal ); | 48 | static Variable mkRef( const Bu::String &sVal ); |
| @@ -54,6 +56,7 @@ public: | |||
| 54 | bool getBool() const; | 56 | bool getBool() const; |
| 55 | const Bu::String &getString() const; | 57 | const Bu::String &getString() const; |
| 56 | const VarList &getList() const; | 58 | const VarList &getList() const; |
| 59 | const void *getOpaque() const; | ||
| 57 | 60 | ||
| 58 | // Conversion functions, they'll return the requested type, maybe an error | 61 | // Conversion functions, they'll return the requested type, maybe an error |
| 59 | // if the source data is really bad | 62 | // if the source data is really bad |
| @@ -77,6 +80,7 @@ public: | |||
| 77 | const Variable &operator=( const double &rhs ); | 80 | const Variable &operator=( const double &rhs ); |
| 78 | const Variable &operator=( const bool &rhs ); | 81 | const Variable &operator=( const bool &rhs ); |
| 79 | const Variable &operator=( const Bu::String &rhs ); | 82 | const Variable &operator=( const Bu::String &rhs ); |
| 83 | const Variable &operator=( void *rhs ); | ||
| 80 | 84 | ||
| 81 | const Variable &operator+=( const Variable &rhs ); | 85 | const Variable &operator+=( const Variable &rhs ); |
| 82 | const Variable &operator<<( const Variable &rhs ); | 86 | const Variable &operator<<( const Variable &rhs ); |
| @@ -102,6 +106,7 @@ private: | |||
| 102 | bool bVal; | 106 | bool bVal; |
| 103 | Bu::String *sVal; | 107 | Bu::String *sVal; |
| 104 | VarList *lVal; | 108 | VarList *lVal; |
| 109 | void *oVal; | ||
| 105 | } uVal; | 110 | } uVal; |
| 106 | 111 | ||
| 107 | void reset( Type eType ); | 112 | void reset( Type eType ); |
