SDC C-Project CF Review 프로그램
ReviewHistory/include/akCore/akFileMgr.h
»õ ÆÄÀÏ
@@ -0,0 +1,80 @@
#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;
   };
}