The LAP library: Symbol

Derived from: none

Declared in: Symbol.h


Overview

The object is pretty self-explanatory. It is meant to store a symbol-related data. As the library can also be used for interpreting stuff, a value attribute was added to the symbol's attributes (for run-time).
The only types of value handled by this object are:

This list will likely be expanded in the future.

The attributes this class owns are:


Constructor and D estructor


Symbol()

 
      Symbol(char* Name, uint32 Kind, int32 IntValue)
      Symbol(char* Name, uint32 Kind, float FloatValue)
      Symbol(char* Name, uint32 Kind, char* StrValue)

Creates a new Symbol whose name is given by Name, whose kinf is given by Kind, and whose type and value are determined by the third argument.
The first constructor defines an integer symbol, the second one a float symbol, and the third one a string symbol.


~Symbol()

 
      ~Symbol(void) 

Destroys the symbol. The name is deleted, and so is its value, if applicable.


Member Functions


Clear()

 
      void Clear()

Clears the name and value attributes. This is used when you create a temporary Symbol with a name or value you need to keep after the object is deleted. Well, this is probably not the case as a simple user, but it was useful to me, for my search routines.

See also ClearName() and ClearStr()


ClearName()

 
      void ClearName()

Clears the name associated with the symbol, see Clear()


ClearStr()

 
      void ClearName()

Clears the value associated with a string symbol, see Clear()


GetName()

 
      char* GetName()

returns the name of the symbol

DONT'T DELETE THE OUTPUT OF THIS FUNCTION, IT IS THE PROPERTY OF THE OBJECT!!!


GetKind()

 
      uint32 GetKind()

returns the kind of the symbol


GetType()

 
      uint32 GetType()

returns the type of the symbol


GetValueInt()

 
      int32 GetValueInt()

returns the integer value of the symbol, regardless of the type or kind stored in the object (no check is performed on whether the symbol's type is appropriate for this method call).


GetValueFloat()

 
      float GetValueFloat()

returns the float value of the symbol, regardless of the type or kind stored in the object (no check is performed on whether the symbol's type is appropriate for this method call).


GetValueStr()

 
      char* GetValueStr()

returns the string value of the symbol, regardless of the type or kind stored in the object (no check is performed on whether the symbol's type is appropriate for this method call).


The LAP library, V0.7, November 3rd 1997, First public release