Resa const la funzione items.
git-svn-id: svn://10.65.10.50/trunk@42 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f18f97314b
commit
224ec2c260
@ -21,7 +21,7 @@ public:
|
||||
TObject& obj() { return *_obj; }
|
||||
|
||||
THash_object(const char* k)
|
||||
{ _key = k; }
|
||||
{ _key = k; }
|
||||
~THash_object() { if (_obj != NULL) delete _obj; }
|
||||
};
|
||||
|
||||
@ -36,9 +36,9 @@ class TAssoc_array : public TObject
|
||||
|
||||
THash_object* _lookup(const char* k, bool& isnew, bool insert = FALSE);
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
int items() { return _cnt; }
|
||||
int items() const { return _cnt; }
|
||||
|
||||
void destroy();
|
||||
|
||||
@ -50,7 +50,7 @@ class TAssoc_array : public TObject
|
||||
|
||||
// aggiunge copia oggetto (deve avere dup()). Vedi l'altra
|
||||
// per i parametri
|
||||
bool add(const char* key, const TObject& obj, bool force = FALSE);
|
||||
bool add(const char* key, const TObject& obj, bool force = FALSE);
|
||||
|
||||
// elimina oggetto; ritorna FALSE se non c'era
|
||||
bool remove(const char* key);
|
||||
@ -58,7 +58,7 @@ class TAssoc_array : public TObject
|
||||
// trova oggetto indicizzato; check se non c'e'
|
||||
// normalmente si usa operator[key]
|
||||
// se l'oggetto aggiunto era NULL ritorna error object
|
||||
TObject& find(const char* key);
|
||||
TObject& find(const char* key);
|
||||
|
||||
// ritorna puntatore o NULL
|
||||
TObject* objptr(const char* key);
|
||||
@ -69,7 +69,7 @@ class TAssoc_array : public TObject
|
||||
// l'indice e' un po' strano ma si usera' questa poiche'
|
||||
// 1) e' intuitivo
|
||||
// 2) fa molto figo
|
||||
TObject& operator[] (const char* key) { return find(key); }
|
||||
TObject& operator[] (const char* key) { return find(key); }
|
||||
|
||||
// iterazione come TToken_string
|
||||
// si puo' adoperare get() e get_hashobj() intercambiabilmente ma
|
||||
|
Loading…
x
Reference in New Issue
Block a user