SDC C-Project CF Review 프로그램
LYW
2022-07-05 63439977901d54a01924ed76290931aeddbce66c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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;
    };
}