/*
....[@@@..[@@@..............[@.................. MUD++ is a written from
....[@..[@..[@..[@..[@..[@@@@@....[@......[@.... scratch multi-user swords and
....[@..[@..[@..[@..[@..[@..[@..[@@@@@..[@@@@@.. sorcery game written in C++.
....[@......[@..[@..[@..[@..[@....[@......[@.... This server is an ongoing
....[@......[@..[@@@@@..[@@@@@.................. development project. All
................................................ contributions are welcome.
....Copyright(C).1995.Melvin.Smith.............. Enjoy.
------------------------------------------------------------------------------
Melvin Smith (aka Fusion) msmith@hom.net
MUD++ development mailing list mudpp@van.ml.org
------------------------------------------------------------------------------
index.h
*/
// index.h
// Written 6-21-95
// Index class for Objects, Mobs, Rooms. Index can be passed
// to a IndexContainer class to obtain an object.
// - Fusion
class Output;
#ifndef INDEX_H
#define INDEX_H
class Index
{
private:
char * scope; // These were originally String's but RAM usage
char * key; // went through the roof, so we are back to char *
protected:
void parse_index_string( const String & );
void parse_index_string( const char * );
public:
Index()
: scope(0), key(0)
{
}
Index( const Index & );
Index( const String & );
Index( const char * );
Index( const String &, const String & );
Index( const char *, const char * );
~Index();
const Index & operator = ( const Index & );
const Index & operator = ( const String & );
const Index & operator = ( const char * );
bool operator == ( const Index & ) const;
void setScope( const char * );
void setScope( const String & );
void setKey( const char * );
void setKey( const String & );
const String getScope() const; // returns "scope"
const String getKey() const; // returns "key"
const String asString() const; // returns "scope::key"
friend Output & operator << ( Output &, const Index & );
};
inline Index::~Index()
{
if( scope ) delete [] scope;
if( key ) delete [] key;
}
#endif