Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
65
CryptoSource/ScriptConvert-GSF File/Utility/TokenlizedFile.h
Normal file
65
CryptoSource/ScriptConvert-GSF File/Utility/TokenlizedFile.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef _CUSTOM_TOKENLIZED_FILE_H_
|
||||
#define _CUSTOM_TOKENLIZED_FILE_H_
|
||||
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
||||
class CTokenlizedFile
|
||||
{
|
||||
public:
|
||||
|
||||
CTokenlizedFile(const char* lpszDelimiter = "\t");
|
||||
~CTokenlizedFile();
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_LINE_BUFFER = 16384,
|
||||
MAX_DELIMITER_NUM = 16,
|
||||
DEFAULT_COLUMN_NUM = 64
|
||||
};
|
||||
|
||||
bool Open(const char* szFilename, const char* szOpenMode = "rt");
|
||||
void Close(void);
|
||||
|
||||
bool ReadColumn(void); // <20>÷<EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20>д´<D0B4>.
|
||||
bool ReadLine(void); // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>д´<D0B4>.
|
||||
|
||||
bool IsEOF(void) { return (NULL != m_lpFile) ? (0 != feof(m_lpFile)) : false; }
|
||||
|
||||
size_t GetColumnNum(void) { return m_ColumnInfo.size(); }
|
||||
size_t GetCurrentLine(void) { return m_nLine; }
|
||||
size_t GetValueNum(void) { return m_ColumnValues.size(); }
|
||||
|
||||
const char* GetColumnName(size_t nIndex);
|
||||
const char* GetStringValue(size_t nIndex);
|
||||
const char* GetStringValue(const char* szColumnName);
|
||||
|
||||
private:
|
||||
|
||||
struct ColumnInfo
|
||||
{
|
||||
unsigned long m_dwHashKey;
|
||||
unsigned int m_dwIndex;
|
||||
const char* m_szColumnName;
|
||||
|
||||
ColumnInfo() : m_dwHashKey(0), m_dwIndex(0), m_szColumnName(0) { }
|
||||
ColumnInfo(const char* szColumnName, unsigned int dwIndex);
|
||||
|
||||
bool operator < (const ColumnInfo& rhsInfo) const { return m_dwHashKey < rhsInfo.m_dwHashKey; }
|
||||
};
|
||||
|
||||
FILE* m_lpFile;
|
||||
size_t m_nLine;
|
||||
|
||||
char m_szDelimiter[MAX_DELIMITER_NUM];
|
||||
char m_szColumn[MAX_LINE_BUFFER];
|
||||
char m_szLine[MAX_LINE_BUFFER];
|
||||
|
||||
typedef std::vector<ColumnInfo> ColumnArray;
|
||||
typedef std::vector<char*> ValueArray;
|
||||
|
||||
ColumnArray m_ColumnInfo;
|
||||
ValueArray m_ColumnValues;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user