CodeSarang.Com
Home | 전체 메뉴 | 질문/답변 Join | Login | 검색   

 

SysUtils.h - 시스템 관련 함수

등록자 : cpueblo (유광희), 2009-01-06

SysUtils.cpp - 시스템 관련 함수

광희가 쓰는 시스템 관련 함수 - SysUtils.cpp

#ifndef __CPUEBLO_SYSUTILS_H__ #define __CPUEBLO_SYSUTILS_H__ // // 최종 수정일 : 2009-01-06 // namespace cpueblo { //===================================================== // // 파일 관련 // //===================================================== /* BOOL __fastcall GetFileSize_Stati64(const char *FileName, ULONGLONG *OutSize); BOOL __fastcall GetFileSize(const char *FileName, ULONGLONG *OutSize); BOOL __fastcall GetFileSize(HANDLE FileHandle, ULONGLONG *OutSize); */ __int64 __fastcall GetFileSize(const char *FileName); __int64 __fastcall GetFileSize(const string &FileName); __int64 __fastcall GetFileSize(const HANDLE FileHandle); BOOL __fastcall SetFileSize(const char *FileName, ULONGLONG NewFileSize); char * GetMsToTimeString(LONG ms); // ms (밀리세컨드) 를 이쁘게 시간:분:초.ms 로 표시 char * GetMsToMinString(LONG ms); // ms (밀리세컨드) 를 이쁘게 분:초로 표시 char * GetMsToMinStringAndPer(LONG ms, LONG TotalMs); // ms (밀리세컨드) 를 이쁘게 분:초로 표시 및 퍼센트 출력 void GetFindFileList(LPCTSTR pszDirectory, LPCTSTR pszFilter, std::vector <std::string> *vtList, bool bFindSubDirectory); void GetFindFileListPathStrip(LPCTSTR pszDirectory, LPCTSTR pszFilter, std::vector <std::string> *vtList, bool bFindSubDirectory); bool GetFileListFromCAB(const char *CabFileName, std::vector<WIN32_FIND_DATA> *lst); BOOL __fastcall DirectoryExists(const char *Directory); BOOL __fastcall DirectoryExists(const string &Directory); BOOL __fastcall FileExists(const char *FileName); BOOL __fastcall FileExists(const string &FileName); BOOL __fastcall DeleteFile(const string &FileName); BOOL __fastcall ForceDirectories(const char *Dir); BOOL __fastcall ForceDirectories(const string &Dir); string __fastcall ExtractFilePath(const string &FileName); // ExtractFilePath('c:\mypath\myfile.ext') => 'c:\mypath\' string __fastcall ExtractFileDir(const string &FileName); // ExtractFileDir ('c:\mypath\myfile.ext') => 'c:\mypath' string __fastcall RemoveFileExt(const string &FileName); string __fastcall RemovePathFirstslash(const string &Path); string __fastcall RemovePathBackslash(const string &Path); BOOL __fastcall CreateDir(const string &Dir); BOOL __fastcall RemoveDir(const string &Dir); BOOL __fastcall RemoveAllSubDir(const string &Dir); __int64 __fastcall GetDiskTotalSize(const string &Dir); // fails returns -1 __int64 __fastcall GetDiskFreeSize(const string &Dir); // // __int64 Total = cpueblo::GetDiskTotalSize("c:"); // __int64 AmtFree = cpueblo::GetDiskFreeSize("c:"); // CString Output; // Output.Format("%I64d percent of the space on drive 0 is free: %I64d MB. Total: %I64d MB", AmtFree*100/Total, AmtFree/1024/1024, Total/1024/1024 ); // Str = 23 percent of the space on drive 0 is free: 23633 MB. Total: 99998 MB // }; #endif

댓글 달기 (로그인이 필요합니다)
제목
내용

http://codesarang.com. mail to cpueblocpueblo.com