Classes | |
| class | common::FileStream |
| Strumień plikowy. More... | |
| class | common::DirLister |
| Klasa do listowania zawartości katalogu. More... | |
Enumerations | |
| enum | common::FILE_ITEM_TYPE { common::IT_NONE, common::IT_DIR, common::IT_FILE } |
Rodzaj elementu systemu plików. More... | |
| enum | common::FILE_MODE { common::FM_WRITE, common::FM_WRITE_PLUS, common::FM_READ, common::FM_READ_PLUS, common::FM_APPEND, common::FM_APPEND_PLUS } |
Tryb otwarcia pliku. More... | |
| enum | common::FILE_ENCODING { common::FILE_ENCODING_UTF16_LE = 1, common::FILE_ENCODING_UTF8 = 2, common::FILE_ENCODING_ANSI = 3, common::FILE_ENCODING_FORCE_BOM = 0x00010000, common::FILE_ENCODING_NO_BOM = 0x00020000, common::FILE_ENCODING_AUTODETECT = 0x00040000 } |
Kodowanie pliku tekstowego. More... | |
Functions | |
| void | common::SaveStringToFile (const tstring &FileName, const string &Data) |
| Zapisuje podany łańcuch jako treść pliku. | |
| void | common::SaveDataToFile (const tstring &FileName, const void *Data, size_t NumBytes) |
| Zapisuje podany łańcuch jako treść pliku. | |
| void | common::LoadStringFromFile (const tstring &FileName, string *Data) |
| Wczytuje całą zawartość pliku do łańcucha. | |
| void | common::SaveStringToFile (const tstring &FileName, const wstring &Data) |
| Wersje Unicode. | |
| void | common::LoadStringFromFile (const tstring &FileName, wstring *Data) |
| bool | common::GetFileItemInfo (const tstring &Path, FILE_ITEM_TYPE *OutType, uint *OutSize, DATETIME *OutModificationTime, DATETIME *OutCreationTime=NULL, DATETIME *OutAccessTime=NULL) |
| Zwraca wybrane informacje na temat pliku/katalogu. | |
| void | common::MustGetFileItemInfo (const tstring &Path, FILE_ITEM_TYPE *OutType, uint *OutSize, DATETIME *OutModificationTime, DATETIME *OutCreationTime=NULL, DATETIME *OutAccessTime=NULL) |
| FILE_ITEM_TYPE | common::GetFileItemType (const tstring &Path) |
| Zwraca typ - czy to jest plik, katalog czy błąd/nie-istnieje. | |
| bool | common::UpdateFileTimeToNow (const tstring &FileName) |
| Ustawia czas dostępu i modyfikacji podanego pliku na bieżący. | |
| void | common::MustUpdateFileTimeToNow (const tstring &FileName) |
| bool | common::UpdateFileTime (const tstring &FileName, const DATETIME &ModificationTime, const DATETIME &AccessTime) |
| Ustawia czas dostępu i modyfikacji podanego pliku na podane. | |
| void | common::MustUpdateFileTime (const tstring &FileName, const DATETIME &ModificationTime, const DATETIME &AccessTime) |
| bool | common::CreateDirectory (const tstring &Path) |
| Tworzy katalog. | |
| void | common::MustCreateDirectory (const tstring &Path) |
| bool | common::DeleteDirectory (const tstring &Path) |
| Usuwa katalog. | |
| void | common::MustDeleteDirectory (const tstring &Path) |
| bool | common::CreateDirectoryChain (const tstring &Path) |
Tworzy całą ścieżkę katalogów aż po podanego, np. "C:\A\B\C" nawet jeśli nie istniał nawet "C:\A". | |
| void | common::MustCreateDirectoryChain (const tstring &Path) |
| bool | common::DeleteFile (const tstring &FileName) |
| Usuwa plik. | |
| void | common::MustDeleteFile (const tstring &FileName) |
| bool | common::MoveItem (const tstring &OldPath, const tstring &NewPath) |
| Przenosi lub zmienia nazwę pliku lub katalogu. | |
| void | common::MustMoveItem (const tstring &OldPath, const tstring &NewPath) |
| void | common::SaveUnicodeToFile (const tstring &FileName, const wstring &Data, unsigned Encoding) |
| Zapisuje tekst Unicode do pliku w podanym kodowaniu. | |
| void | common::SaveUnicodeToFile (const tstring &FileName, const wchar_t *Data, unsigned NumChars, unsigned Encoding) |
| void | common::SaveUnicodeToStream (Stream *Dest, const wstring &Data, unsigned Encoding) |
| void | common::SaveUnicodeToStream (Stream *Dest, const wchar_t *Data, unsigned NumChars, unsigned Encoding) |
| void | common::LoadUnicodeFromFile (const tstring &FileName, wstring *Out, unsigned Encoding, FILE_ENCODING *OutEncoding=NULL) |
| Wczytuje plik tekstowy do łańcucha Unicode. | |
| void | common::LoadUnicodeFromFile (const tstring &FileName, string *Out, unsigned Encoding, FILE_ENCODING *OutEncoding=NULL) |
| Wczytuje plik tekstowy do łańcucha ANSI. | |
| void | common::LoadUnicodeFromStream (SeekableStream *Src, wstring *Out, unsigned Encoding, FILE_ENCODING *OutEncoding=NULL) |
| void | common::LoadUnicodeFromStream (SeekableStream *Src, string *Out, unsigned Encoding, FILE_ENCODING *OutEncoding=NULL) |
Dokumentacja: Module_Files
Nagłówek: Files.hpp
Kodowanie pliku tekstowego.
| enum common::FILE_MODE |
Tryb otwarcia pliku.
| bool common::CreateDirectory | ( | const tstring & | Path | ) |
Tworzy katalog.
| bool common::CreateDirectoryChain | ( | const tstring & | Path | ) |
Tworzy całą ścieżkę katalogów aż po podanego, np. "C:\A\B\C" nawet jeśli nie istniał nawet "C:\A".
| bool common::DeleteDirectory | ( | const tstring & | Path | ) |
Usuwa katalog.
Katalog musi być pusty.
| bool common::DeleteFile | ( | const tstring & | FileName | ) |
Usuwa plik.
| bool common::GetFileItemInfo | ( | const tstring & | Path, | |
| FILE_ITEM_TYPE * | OutType, | |||
| uint * | OutSize, | |||
| DATETIME * | OutModificationTime, | |||
| DATETIME * | OutCreationTime = NULL, |
|||
| DATETIME * | OutAccessTime = NULL | |||
| ) |
Zwraca wybrane informacje na temat pliku/katalogu.
Jako parametry wyjściowe można podawać NULL. Jeśli to katalog, zwrócony rozmiar jest niezdefiniowany.
| FILE_ITEM_TYPE common::GetFileItemType | ( | const tstring & | Path | ) |
Zwraca typ - czy to jest plik, katalog czy błąd/nie-istnieje.
Jeśli błąd lub nie istnieje, zwraca common::IT_NONE.
| void common::LoadStringFromFile | ( | const tstring & | FileName, | |
| wstring * | Data | |||
| ) |
| void common::LoadStringFromFile | ( | const tstring & | FileName, | |
| string * | Data | |||
| ) |
Wczytuje całą zawartość pliku do łańcucha.
| void common::LoadUnicodeFromFile | ( | const tstring & | FileName, | |
| string * | Out, | |||
| unsigned | Encoding, | |||
| FILE_ENCODING * | OutEncoding = NULL | |||
| ) |
Wczytuje plik tekstowy do łańcucha ANSI.
Wspiera te same kodowania co common::OutEncoding.
| void common::LoadUnicodeFromFile | ( | const tstring & | FileName, | |
| wstring * | Out, | |||
| unsigned | Encoding, | |||
| FILE_ENCODING * | OutEncoding = NULL | |||
| ) |
Wczytuje plik tekstowy do łańcucha Unicode.
| Encoding,: |
| |
| OutEncoding | - zwraca wykryte kodowanie. Jeśli cię nie interesuję, możesz podać NULL. |
| void common::LoadUnicodeFromStream | ( | SeekableStream * | Src, | |
| string * | Out, | |||
| unsigned | Encoding, | |||
| FILE_ENCODING * | OutEncoding = NULL | |||
| ) |
| void common::LoadUnicodeFromStream | ( | SeekableStream * | Src, | |
| wstring * | Out, | |||
| unsigned | Encoding, | |||
| FILE_ENCODING * | OutEncoding = NULL | |||
| ) |
Przenosi lub zmienia nazwę pliku lub katalogu.
Katalogi można przenosić tylko w ramach jednej partycji. Pliki niekoniecznie.
| void common::MustCreateDirectory | ( | const tstring & | Path | ) |
| void common::MustCreateDirectoryChain | ( | const tstring & | Path | ) |
| void common::MustDeleteDirectory | ( | const tstring & | Path | ) |
| void common::MustDeleteFile | ( | const tstring & | FileName | ) |
| void common::MustGetFileItemInfo | ( | const tstring & | Path, | |
| FILE_ITEM_TYPE * | OutType, | |||
| uint * | OutSize, | |||
| DATETIME * | OutModificationTime, | |||
| DATETIME * | OutCreationTime = NULL, |
|||
| DATETIME * | OutAccessTime = NULL | |||
| ) |
| void common::MustUpdateFileTime | ( | const tstring & | FileName, | |
| const DATETIME & | ModificationTime, | |||
| const DATETIME & | AccessTime | |||
| ) |
| void common::MustUpdateFileTimeToNow | ( | const tstring & | FileName | ) |
| void common::SaveDataToFile | ( | const tstring & | FileName, | |
| const void * | Data, | |||
| size_t | NumBytes | |||
| ) |
Zapisuje podany łańcuch jako treść pliku.
| void common::SaveStringToFile | ( | const tstring & | FileName, | |
| const wstring & | Data | |||
| ) |
Wersje Unicode.
| void common::SaveStringToFile | ( | const tstring & | FileName, | |
| const string & | Data | |||
| ) |
Zapisuje podany łańcuch jako treść pliku.
| void common::SaveUnicodeToFile | ( | const tstring & | FileName, | |
| const wchar_t * | Data, | |||
| unsigned | NumChars, | |||
| unsigned | Encoding | |||
| ) |
| void common::SaveUnicodeToFile | ( | const tstring & | FileName, | |
| const wstring & | Data, | |||
| unsigned | Encoding | |||
| ) |
Zapisuje tekst Unicode do pliku w podanym kodowaniu.
Musisz podać jedną flagę common::FILE_ENCODING z kodowaniem. Możesz dodać jedną z flag wymuszając nagłówek BOM lub jego brak.
| void common::SaveUnicodeToStream | ( | Stream * | Dest, | |
| const wchar_t * | Data, | |||
| unsigned | NumChars, | |||
| unsigned | Encoding | |||
| ) |
| void common::SaveUnicodeToStream | ( | Stream * | Dest, | |
| const wstring & | Data, | |||
| unsigned | Encoding | |||
| ) |
| bool common::UpdateFileTime | ( | const tstring & | FileName, | |
| const DATETIME & | ModificationTime, | |||
| const DATETIME & | AccessTime | |||
| ) |
Ustawia czas dostępu i modyfikacji podanego pliku na podane.
| bool common::UpdateFileTimeToNow | ( | const tstring & | FileName | ) |
Ustawia czas dostępu i modyfikacji podanego pliku na bieżący.
1.6.1