textfile.hxx tstring LoadText (LPCTSTR pathName) { v_char v_chr = ::v_c_Load(pathName) ; tstring tStr = ::To_tstring(v_chr) ; return tStr ; }
i_v_type.hxx typedef std::vector<char> v_char ; typedef const std::vector<char> c_v_char ;
vchrfile.hxx v_char v_c_Load (LPCTSTR pathName) { v_char text ; FILE* ifp = ::Open_File(pathName,_T("rb")) ; if (ifp == NULL) { // ::Log_Message((tstring(_T("Can't open rb "))+pathName).c_str()) ; return text ; } size_t fSize = size_t(F_Stat::GetSize(pathName)) ; text.resize(fSize) ; if (fSize > 0) { ::fread(&text[0],sizeof(char),fSize,ifp) ; } ::fclose(ifp) ; return text ; } openfile.hxx filestat.hxx
textfile.hxx tstring To_tstring (const v_char& v_chr) { tstring tStr ; #ifdef _MSC_VER tStr = ::to_tstring_msc (v_chr) ; #else tStr = ::to_tstring_gnuc(v_chr) ; #endif return tStr ; } text_msc.hxx text_gnc.hxx text_cc.hxx