1 #include <iostream> 2 #include <string> 3 #include <stdint.h> 4 #include <map> 5 #include <fstream> 6 #include <stdlib.h> 7 #include <stdio.h> 8 9 enum 10 { 11 enmMaxConfigWordLen = 32, 12 }; 13 14 typedef std::map<std::string,std::string> ATTRMAP; 15 16 17 void GetTextFileContent(const char *fileName,char buf[],const uint32_t maxBufLen,uint32_t &readBufLen) 18 { 19 std::ifstream file(fileName,std::ios::in); 20 if(!file) 21 { 22 return ; 23 } 24 char c; 25 readBufLen = 0; 26 while(file.get(c) && readBufLen < maxBufLen) 27 { 28 if(c != ' ' && c != ' ' && c != 9) 29 { 30 buf[readBufLen++] = c; 31 } 32 } 33 buf[readBufLen]='