Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

61 lines
1.1 KiB

/*===================================================================
Microsoft Denali
Microsoft Confidential.
Copyright 1997 Microsoft Corporation. All Rights Reserved.
Component: MetaUtil object
File: ChkMeta.cpp
Owner: t-BrianM
This file contains the headers for the objects related to the
CheckSchema and CheckKey methods.
===================================================================*/
#include "stdafx.h"
#include "MetaUtil.h"
#include "MUtilObj.h"
#define NAME_TABLE_HASH_SIZE 1559
class CNameTable;
class CNameTableEntry {
friend CNameTable;
public:
CNameTableEntry() : m_tszName(NULL),
m_pCHashNext(NULL) { }
HRESULT Init(LPCTSTR tszName);
~CNameTableEntry() {
if (m_tszName != NULL) {
delete m_tszName;
}
}
private:
LPTSTR m_tszName;
CNameTableEntry *m_pCHashNext;
};
class CNameTable {
public:
CNameTable();
~CNameTable();
BOOL IsCaseSenDup(LPCTSTR tszName);
BOOL IsCaseInsenDup(LPCTSTR tszName);
HRESULT Add(LPCTSTR tszName);
private:
CNameTableEntry *m_rgpNameTable[NAME_TABLE_HASH_SIZE];
int Hash(LPCTSTR tszName);
};