#pragma once
|
|
|
|
#include "akCoreLinker.h"
|
#include <vector>
|
|
struct AKCORE_DLLSPEC _Attribute
|
{
|
_Attribute()
|
{
|
memset(Title , 0, sizeof(char)*128);
|
memset(Attribute , 0, sizeof(char)*128);
|
memset(Value , 0, sizeof(char)*128);
|
}
|
char Title[128];
|
char Attribute[128];
|
char Value[128];
|
};
|
|
struct AKCORE_DLLSPEC _Title
|
{
|
_Title(char* title)
|
{
|
strcpy(Title, title);
|
};
|
bool compare(char* title)
|
{
|
if(strcmp(title, Title) == 0 && strlen(title) == strlen(Title))
|
{
|
return true;
|
}
|
return false;
|
};
|
void clear()
|
{
|
memset(Title, 0, sizeof(char)*128);
|
};
|
char Title[128];
|
};
|
|
namespace akCore
|
{
|
class AKCORE_DLLSPEC CakFileMgr
|
{
|
public:
|
CakFileMgr(void);
|
~CakFileMgr(void);
|
|
//ŸÀÌÆ² ¼³Á¤(OpenFile()ÇÔ¼ö¿Í MakeFile()ÇÔ¼ö¸¦ È£ÃâÇϸé ŸÀÌÆ²¼ÂÆÃÀº NullÀÌ µÈ´Ù)
|
void SetTitle(char* title);
|
|
//¾²±â °ü·Ã
|
//ŸÀÌÆ²À» Á¤ÇÑ´Ù.
|
bool SetAttribute(char* Attribute, int value);
|
bool SetAttribute(char* Attribute, double value);
|
bool SetAttribute(char* Attribute, char* value);
|
bool SetAttribute(char* Attribute, float value);
|
//¾²±â ¹öÆÛ¿¡ ÀúÀåµÈ µ¥ÀÌÅ͸¦ ÆÄÀÏ·Î ÀúÀå
|
bool MakeFile(char* filepath);
|
|
|
//Àб⠰ü·Ã
|
//ÆÄÀÏ ¿±â(¾²±âÁغñÁßÀÌ¿´´Ù¸é ¾²±â ¹öÆÛ´Â ÃʱâÈ µÈ´Ù)
|
bool OpenFile(char* filepath);
|
bool GetAttribute(char* Attribute, int& value);
|
bool GetAttribute(char* Attribute, double& value);
|
bool GetAttribute(char* Attribute, char* value);
|
bool GetAttribute(char* Attribute, float& value);
|
|
private:
|
//ºü¸¥ ã±â¸¦ À§Çؼ ÀúÀåµÈ µ¥ÀÌÅÍ Á¤·Ä
|
void DataSort();
|
char m_Title[128];
|
std::vector<_Attribute> m_data;
|
|
char* m_buffer;
|
int m_fastIndex;
|
};
|
}
|