GenerateReInitArray.h

 #ifndef __GENERATE_REINIT_ARRAY_H__
#define __GENERATE_REINIT_ARRAY_H__

#include "stdio.h"
#include "string.h"
#include "stdlib.h"

const unsigned char MAX_LINE_LENGTH  = 255;
const unsigned short MAX_REINIT_DATA = 1024; 

class GenerateReInitArray
{
private:

FILE *SourceFile;
FILE *TargetFile;
char *fileName;
char *TargetFileName;
bool hashIfFlag;
bool hashElseFlag;
bool hashEndFlag;
char line [MAX_LINE_LENGTH];
char ArrayName [MAX_LINE_LENGTH];
char ReInitData [MAX_REINIT_DATA];
char CompleteReInitData [MAX_REINIT_DATA*8];
char StringIdName[MAX_LINE_LENGTH];

public:
GenerateReInitArray(char **argv);
~GenerateReInitArray();

void OpenFile();
void CloseFile();
bool ReadFile();
bool ReadLine();
char *GetFileNameWithoutExtn();
bool GetArrayName();
void GetReInitArrayData();
void ProcessReInitArrayData();
bool GetStringIdName(char *tempLine);
void DumpDataToBuffer();
void DumpDataToFile();
void FlushData();
void RestoreFlags();
bool SearchHashSymbol( char *tempLine);
};
#endif //__GENERATE_REINIT_ARRAY_H__

Project Homepage: