#include <ExCFile2.h>
Membres publics | |
ExCFile2 () | |
~ExCFile2 () | |
tFileInfo | LoadFile (std::string FileName) |
tFileInfo | GetFileInfo (void) |
float | GetElementFloatAt (int position) |
std::string | GetElementStringAt (int position) |
int | GetElementIntAt (int position) |
Attributs Privés | |
std::vector< std::string > | m_VecElement |
std::vector< std::string >::iterator | m_ItVecElement |
tFileInfo | m_Info |
|
Définition à la ligne 27 du fichier ExCFile2.cpp.
00028 { 00029 00030 } |
|
Définition à la ligne 32 du fichier ExCFile2.cpp.
00033 { 00034 } |
|
Définition à la ligne 91 du fichier ExCFile2.cpp. Références GetElementFloatAt(), Guard, et m_VecElement. Référencé par GetElementFloatAt().
00092 { 00093 Guard(float ExCFile2::GetElementFloatAt(int position)) 00094 try 00095 { 00096 return atof(m_VecElement.at(position).data()); 00097 }catch(...) 00098 { 00099 return 0; 00100 } 00101 UnGuard 00102 } |
|
Définition à la ligne 117 du fichier ExCFile2.cpp. Références GetElementIntAt(), Guard, et m_VecElement. Référencé par GetElementIntAt().
00118 { 00119 Guard(int ExCFile2::GetElementIntAt(int position)) 00120 try 00121 { 00122 return atoi(m_VecElement.at(position).data()); 00123 }catch(...) 00124 { 00125 return 0; 00126 } 00127 UnGuard 00128 } |
|
Définition à la ligne 104 du fichier ExCFile2.cpp. Références GetElementStringAt(), Guard, et m_VecElement. Référencé par GetElementStringAt().
00105 { 00106 Guard(std::string ExCFile2::GetElementStringAt(int position)) 00107 try 00108 { 00109 return m_VecElement.at(position); 00110 }catch(...) 00111 { 00112 return "NULL"; 00113 } 00114 UnGuard 00115 } |
|
Définition à la ligne 56 du fichier ExCFile2.h.
00056 {return m_Info;} |
|
Définition à la ligne 36 du fichier ExCFile2.cpp. Références tFileInfo::m_FileName, tFileInfo::m_FileType, m_Info, tFileInfo::m_NumberElement, et m_VecElement.
00037 { 00038 char ch; 00039 int RetVal; 00040 FILE *MyFile; 00041 std::string StBuffer; 00042 00043 m_Info.m_NumberElement=0; 00044 m_Info.m_FileName=FileName; 00045 MyFile=fopen (FileName.data(),"r"); 00046 if(!MyFile) 00047 { 00048 m_Info.m_NumberElement=-1; 00049 return m_Info; 00050 } 00051 00052 //------------------------------- 00053 //Reading file type 00054 //------------------------------- 00055 fseek(MyFile,0,SEEK_SET); 00056 do 00057 { 00058 RetVal=fread(&ch,sizeof(char),1,MyFile); 00059 }while(ch!='#'); 00060 do 00061 { 00062 RetVal=fread(&ch,sizeof(char),1,MyFile); 00063 StBuffer=StBuffer+ch; 00064 }while(ch!='#'); 00065 StBuffer.erase(StBuffer.end()-1,StBuffer.end()); 00066 m_Info.m_FileType=StBuffer; 00067 //------------------------------- 00068 //Reading data 00069 //------------------------------- 00070 while(!feof(MyFile)) 00071 { 00072 StBuffer.erase(StBuffer.begin(),StBuffer.end()); 00073 do 00074 { 00075 RetVal=fread(&ch,sizeof(char),1,MyFile); 00076 if(ch!='\n')StBuffer=StBuffer+ch; 00077 }while(ch!='#'); 00078 StBuffer.erase(StBuffer.end()-1,StBuffer.end()); 00079 m_VecElement.push_back(StBuffer); 00080 m_Info.m_NumberElement++; 00081 } 00082 fclose(MyFile); 00083 00084 std::cout<<"File Name :"<<m_Info.m_FileName<<std::endl; 00085 std::cout<<"File Type :"<<m_Info.m_FileType<<std::endl; 00086 std::cout<<"Numb elem :"<<m_Info.m_NumberElement<<std::endl; 00087 00088 return m_Info; 00089 } |
|
Définition à la ligne 44 du fichier ExCFile2.h. Référencé par LoadFile(). |
|
Définition à la ligne 43 du fichier ExCFile2.h. |
|
Définition à la ligne 42 du fichier ExCFile2.h. Référencé par GetElementFloatAt(), GetElementIntAt(), GetElementStringAt(), et LoadFile(). |