Val.h
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:1k
- // Val.h: interface for the CVal class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_VAL_H__ED1B6BD1_F9EC_4596_B932_9CDB2427D1E7__INCLUDED_)
- #define AFX_VAL_H__ED1B6BD1_F9EC_4596_B932_9CDB2427D1E7__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //*
- #define VALMAP map<string, CVal*>
- #define PVALMAP VALMAP*
- #define VALLIST vector<CVal*>
- #define PVALLIST VALLIST*
- //*/
- enum eValType{VT_LONG, VT_PSTR, VT_PMAP, VT_PLIST};
- class CVal
- {
- public:
- CVal(long lSrc);
- CVal(string strSrc);
- CVal(char* pstrSrc, long lstrLenSrc);
- CVal(PVALMAP pmapSrc);
- CVal(PVALLIST plistSrc);
- virtual ~CVal();
-
- operator char*()const;
- // operator long()const;
- long size();
- CVal& operator = (CVal& v);
- // operator string()const;
- CVal* operator [](string strKey);
- CVal* operator [](int inx);
-
- static void test();
-
- long lstrLen;
- unsigned long lVal;
- char* pstrVal;
- PVALMAP pmapVal;
- PVALLIST plistVal;
-
- eValType vt;
- private:
- void setBuf(char* pstrSrc, long lstrLenSrc);
- };
- #endif // !defined(AFX_VAL_H__ED1B6BD1_F9EC_4596_B932_9CDB2427D1E7__INCLUDED_)