Browse Source

water: cleanup file related code, add winMyDocuments property

Signed-off-by: falkTX <falktx@falktx.com>
pull/1780/head
falkTX 1 year ago
parent
commit
aa85fae43a
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 10 additions and 21 deletions
  1. +4
    -0
      source/modules/water/files/File.cpp
  2. +1
    -19
      source/modules/water/files/File.h
  3. +3
    -0
      source/modules/water/files/FileInputStream.cpp
  4. +2
    -2
      source/modules/water/text/String.h

+ 4
- 0
source/modules/water/files/File.cpp View File

@@ -1158,6 +1158,10 @@ File File::getSpecialLocation (const SpecialLocationType type)
csidlType = CSIDL_PROGRAM_FILES_COMMON;
break;
case winMyDocuments:
csidlType = CSIDL_MYDOCUMENTS;
break;
default:
wassertfalse; // unknown type?
return File();


+ 1
- 19
source/modules/water/files/File.h View File

@@ -347,22 +347,6 @@ public:
*/
bool isHidden() const;
/** Returns a unique identifier for the file, if one is available.
Depending on the OS and file-system, this may be a unix inode number or
a win32 file identifier, or 0 if it fails to find one. The number will
be unique on the filesystem, but not globally.
*/
uint64 getFileIdentifier() const;
/** If possible, this will try to create a version string for the given file.
The OS may be able to look at the file and give a version for it - e.g. with
executables, bundles, dlls, etc. If no version is available, this will
return an empty string.
*/
String getVersion() const;
//==============================================================================
/** Creates an empty file if it doesn't already exist.
@@ -665,7 +649,7 @@ public:
hostApplicationPath,
/** Windows specific paths */
winAppData, winProgramFiles, winCommonProgramFiles
winAppData, winProgramFiles, winCommonProgramFiles, winMyDocuments
};
/** Finds the location of a special type of file or directory, such as a home folder or
@@ -786,8 +770,6 @@ private:
bool copyInternal (const File&) const;
bool moveInternal (const File&) const;
bool replaceInternal (const File&) const;
bool setFileTimesInternal (int64 m, int64 a, int64 c) const;
void getFileTimesInternal (int64& m, int64& a, int64& c) const;
bool setFileReadOnlyInternal (bool) const;
bool setFileExecutableInternal (bool) const;
};


+ 3
- 0
source/modules/water/files/FileInputStream.cpp View File

@@ -106,7 +106,10 @@ size_t FileInputStream::readInternal (void* buffer, size_t numBytes)
{
DWORD actualNum = 0;
if (! ReadFile ((HANDLE) fileHandle, buffer, (DWORD) numBytes, &actualNum, 0))
{
status = getResultForLastError();
actualNum = 0;
}
return (size_t) actualNum;
}


+ 2
- 2
source/modules/water/text/String.h View File

@@ -990,7 +990,7 @@ public:
To find out how many bytes you need to store this string as UTF-8, you can call
CharPointer_UTF8::getBytesRequiredFor (myString.getCharPointer())
@see toRawUTF8, getCharPointer, toUTF16, toUTF32
@see toRawUTF8, getCharPointer, toUTF16
*/
CharPointer_UTF8 toUTF8() const;
@@ -1008,7 +1008,7 @@ public:
To find out how many bytes you need to store this string as UTF-8, you can call
CharPointer_UTF8::getBytesRequiredFor (myString.getCharPointer())
@see getCharPointer, toUTF8, toUTF16, toUTF32
@see getCharPointer, toUTF8, toUTF16
*/
const char* toRawUTF8() const;


Loading…
Cancel
Save