Files
Nasal-Interpreter/nasal_hash.h
Valk Richard Li e35311b7d0 basical elements
2019-08-05 23:12:26 +08:00

42 lines
658 B
C++

#ifndef __NASAL_HASH_H__
#define __NASAL_HASH_H__
#include <iostream>
#include <cstring>
#include "nasal_list.h"
namespace nasal
{
#ifndef nil
#define nil -1
#endif
struct HashUnit
{
std::string VarName;
std::string Type;
void *data;
HashUnit* next;
};
class NasalHash
{
private:
HashUnit *head;
public:
NasalHash();
NasalHash(NasalHash&);
~NasalHash();
void PrintHash();
void Append(const char *,void *,const char *);
int Contains(const char *);
NasalList Keys();
void Delete(const char *);
NasalHash& operator=(const NasalHash&);
HashUnit SearchElement(std::string &);
};
}
#endif