![]() | InDesign SDK 20.5 |
Public Types | |
| enum | ViewMode { kNormal, kOpenNewWindow, kOpenMaximized } |
| enum | Access { kRead, kWrite, kReadWrite } |
Static Public Member Functions | |
| static char | GetDirectorySeperator () |
| static bool16 | SetAppFolder (SysConnection appResourceHandle=nil) |
| static bool16 | GetAppFolder (IDFile *appFolder) |
| static bool16 | GetAppFolder (PMString *appFolder) |
| static bool16 | GetAppPath (IDFile *appPath) |
| static bool16 | GetAppSubFolder (IDFile *result, const PMString &subFolderName) |
| static bool16 | GetUserRoamingFolder (IDFile *result, const PMString &appFolder, const PMString &subFolderName) |
| static bool16 | GetAppLocalCachedDataFolder (IDFile *result, const PMString &subFolderName) |
| static bool16 | GetAppRoamingDataFolder (IDFile *result, const PMString &subFolderName) |
| static bool16 | GetAppDocumentFolder (IDFile *result, const PMString &subFolderName) |
| static bool16 | GetRecoveryFolder (IDFile *result, const PMString &subFolderName) |
| static bool16 | GetUserDictionariesFolder (IDFile *result, const PMString &subFolderName) |
| static bool16 | SetCurrentFolder (const IDFile &targetFolder) |
| static bool16 | GetCurrentFolder (IDFile *currentFolder) |
| static void | AppendPath (IDFile *originalPath, const PMString &pathToAppend) |
| static void | GetFileName (const IDFile &fSpec, PMString &fileName) |
| static void | GetFileName (const PMString &pathStr, PMString &fileName) |
| static bool16 | IsEqual (const IDFile &file1, const IDFile &file2) |
| static bool | SwapFiles (const IDFile &file1, const IDFile &file2) |
| static void | IDFileToPMString (const IDFile &file, PMString &pathStr) |
| static void | PMStringToIDFile (const PMString &pathStr, IDFile &file) |
| static PMString | SysFileToPMString (const IDFile &file) |
| static IDFile | PMStringToSysFile (const PMString &pathStr) |
| static PMString | SysFileToFileURL (const IDFile &fSpec) |
| static PMString | PMStringToFileURL (const PMString &fileName) |
| static PMString | PMStringToURL (const PMString &str) |
| static PMString | URLToPMString (const std::string &URL) |
| static std::string | UTF8ToURL (const std::string &str, const char kSeparator) |
| static std::string | URLToUTF8 (const std::string &fileURL, bool &ContainsUTF16) |
| static PMString | FileURLToPMString (const std::string &fileURL) |
| static PMString | FileURLToPMString (const PMString &__fileURL) |
| static IDFile | FileURLToSysFile (const std::string &__fileURL, bool *isReturingAValidSysFile=NULL) |
| static IDFile | FileURLToSysFile (const PMString &__fileURL, bool *isReturingAValidSysFile=NULL) |
| static PMString * | CreateResolvedPathName (const PMString &pathName) |
| static uint32 | SpaceAvail (const IDFile &diskToCheck) |
| static bool16 | IsDirectory (const IDFile &fileSpec) |
| static bool16 | CreateFolderIfNeeded (const IDFile &folderFileSpec, bool16 bCreateParent=kFalse) |
| static bool16 | CopyFile (const IDFile &srcFile, const IDFile &dstFile) |
| static bool16 | MoveFile (const IDFile &srcFile, const IDFile &dstFolder, IDFile *dstFile=NULL) |
| static bool16 | GetParentDirectory (IDFile const &file, IDFile &parent) |
| static bool16 | DoesFileExist (const IDFile &fileSpec) |
| static void | GetPathOnly (const IDFile &fileSpec, PMString &pathName, bool16 includeSeparator=kFalse) |
| static void | GetBaseFileName (const IDFile &inFile, PMString &outString) |
| static void | GetBaseFileName (const PMString &inString, PMString &outString) |
| static void | GetExtension (const IDFile &inFile, PMString &outString) |
| static uint32 | GetFileSize (const IDFile &fileSpec, bool16 includeResourceFork=kFalse) |
| static bool16 | GetOpenFileType (const IDFile &sysFile, SysFileType &type) |
| static bool16 | GetStreamFileType (IPMStream *stream, SysFileType &type) |
| static void | GetVolumeName (const IDFile *fileOrFolderSpec, PMString *volumeName) |
| static bool16 | OnSameVolume (const IDFile &file1, const IDFile &file2) |
| static int32 | ShowFile (const IDFile &fileSpec) |
| static ErrorCode | BrowseToFile (const IDFile *fileSpec, ViewMode mode=kNormal) |
| static ErrorCode | OpenFileInEditor (const IDFile &fileToOpen, const AppInfo &appInfo=kNullAppInfo, PMString *errorString=nil) |
| static bool16 | IsNetworkDrive (const IDFile &sysFile) |
| static bool16 | GetAppInstallationFolder (IDFile *folder) |
| static bool16 | GetPresetsFolder (IDFile *folder, const PMString &subFolderName, const PMLocaleId &localeId) |
| static void | AppendLocalizedFolder (IDFile *folder, const PMLocaleId &localeId) |
| static bool16 | GetModificationDate (const IDFile &spec, uint32 *modDate) |
| static bool8 | CanOpen (const IDFile &spec, Access access=kReadWrite) |
| static void | PrefixFileURL (const PMString &prefix, PMString &fileURL) |
| static FILE * | OpenFile (const IDFile &file, const char *mode) |
| static FILE * | OpenFile (const PMString &path, const char *mode) |
| static FILE * | OpenFile (const char *path, const char *mode) |
| static bool16 | IsAppRoamingDataFolderNew () |
| static bool16 | GetAppLocalCachedDataFolderSansLocale (IDFile *result) |
| static textchar | GetDirectorySeparatorTextChar () |
| static bool16 | IsTemplate (const IDFile &file) |
| static bool16 | IsTempFile (const IDFile &file) |
| static void | CreateUniqueFileName (PMString &fileName) |
| static IDataBase::DBResultCode | CheckFileAccessibleForSaving (const IDFile &destFile) |
| static PMString | GetDirectorySeparatorPMString () |
| static void | AppendPaths (IDFile *originalPath, const std::vector< PMString > &pathsToAppend) |
| static void | AppendPaths (IDFile *originalPath, const std::vector< const wchar_t * > &pathsToAppend) |
| static char | GetPosixDirectorySeparator () |
| static textchar | GetPosixDirectorySeparatorTextChar () |
| static PMString | GetPosixDirectorySeparatorPMString () |
| static CFURLPathStyle | GetMacPathStyle () |
| static char | GetMacDirectorySeparator () |
| static textchar | GetMacDirectorySeparatorTextChar () |
| static PMString | GetMacDirectorySeparatorPMString () |
| static |
Appends a localized folder name to the passed in folder argument. The folder name that is appended corresponds to the current user interface id in current locale. e.g. if presets folder was passed in, would append "en_US" for English, "fr_FR" for French, etc.
| folder | IN/OUT the output path to modify |
| localeId | IN Will append a localized folder name (e.g. "en_US") depending on PMLocaleId passed in. Typically LocaleSetting::GetLocale() is passed for this argument. However, you can pass an default PMLocaleId() if you want no localized folder appended. |
| static |
| static |
Check if file is accessible for saving.
| destFile | IN IDFile destination file path |
| static |
Creates a unique file name incorporating the base file name passed in as parameter and appending process and/or thread id and some timestamp info. File name generated is not guaranteed to not already exist. This is typically used only for generating unique names for temporary files. If the calling code needs to ensure that an existing file is not overwritten, it should check for file existence and retry this function call (only the timestamp info will change in subsequent retries).
| fileName | IN/OUT incoming base file name, generated name is returned via this parameter. |
| static |
FileURLToPMString the perfered function call is static PMString FileURLToPMString (const std::string &__fileURL);
FileURLToPMString converts from a file url to a PMString system path on the pc this system path will eather be a UNC path if the url species a file not on the local host (file:/// or file://localhost/) and otherwise the encoded system path UNC path = \myhost System path = c:
On the mac the path returned will be a path made up of 31 char FsSpec file names if the Posix path is desired FileURLToPosixPath can be called. mac path: "my hd:my folder:my file"
| fileURL | File URL |
FileURLToPMString the perfered function call is static PMString FileURLToPMString (const std::string &__fileURL);
FileURLToPMString converts from a file url to a PMString system path on the pc this system path will eather be a UNC path if the url species a file not on the local host (file:/// or file://localhost/) and otherwise the encoded system path UNC path = \myhost System path = c:
On the mac the path returned will be a path made up of 31 char FsSpec file names if the Posix path is desired FileURLToPosixPath can be called. mac path: "my hd:my folder:my file"
| fileURL | File URL |
| static |
FileURLToSysFile converts from a file url to a sysfile static IDFile FileURLToSysFile(const std::string& __fileURL, bool *isReturingAValidSysFile = NULL); is the prefered function call
PC: on the PC this function should always succeeds aka (isReturingAValidSysFile should always be set to true on exit) if the url descibes a UNC path the file returned will obviously be a unc file path if the URL isn't unc the sysfile returned will be a standard path/
file://myhost/mydir/myfile will result in \myhost file://localhost/c:/mydir/myfile will result in c: file:///c:/mydir/myfile will result in c:
MAC: On the Mac FSSpec can be made to point to files that don't exist, but the directory heiarchary must exist so this function might fail. if it fails the optional paramater isReturingAValidSysFile will return false and the FSSpec returned in the sysfile should be zeroed and it shouldn't have a truename The mac also cant take UNC paths so don't even think about them.
If the URL decribes a directory which exists but a file which doesn't the function will succeed but the FSSpec will point to a file which doesn't exist. The TrueName for the FSSpec is set to the Unicode name described in the FileURL, the FSSpec name is set to a 31 byte platform char name. If the URL name is greater then 31 characters then it is truncated.
file:///myfolder/myfile Valid FSSpec if my folder exists on the default vol file://localhost/myfolder/myfile Valid FSSpec if my folder exists on the default vol
| __fileURL | File URL to convert to a sys file |
| isReturingAValidSysFile | optional paramater, if a bool is passed in, the bool will be set to true if a valid IDFile is being returned on the PC this is always true, on the mac it can be true or false (see above) |
| static |
FileURLToSysFile converts from a file url to a sysfile static IDFile FileURLToSysFile(const std::string& __fileURL, bool *isReturingAValidSysFile = NULL); is the prefered function call
PC: on the PC this function should always succeeds aka (isReturingAValidSysFile should always be set to true on exit) if the url descibes a UNC path the file returned will obviously be a unc file path if the URL isn't unc the sysfile returned will be a standard path/
file://myhost/mydir/myfile will result in \myhost file://localhost/c:/mydir/myfile will result in c: file:///c:/mydir/myfile will result in c:
MAC: On the Mac FSSpec can be made to point to files that don't exist, but the directory heiarchary must exist so this function might fail. if it fails the optional paramater isReturingAValidSysFile will return false and the FSSpec returned in the sysfile should be zeroed and it shouldn't have a truename The mac also cant take UNC paths so don't even think about them.
If the URL decribes a directory which exists but a file which doesn't the function will succeed but the FSSpec will point to a file which doesn't exist. The TrueName for the FSSpec is set to the Unicode name described in the FileURL, the FSSpec name is set to a 31 byte platform char name. If the URL name is greater then 31 characters then it is truncated.
file:///myfolder/myfile Valid FSSpec if my folder exists on the default vol file://localhost/myfolder/myfile Valid FSSpec if my folder exists on the default vol
| __fileURL | File URL to convert to a sys file |
| isReturingAValidSysFile | optional paramater, if a bool is passed in, the bool will be set to true if a valid IDFile is being returned on the PC this is always true, on the mac it can be true or false (see above) |
| static |
Finds a specified sub-folder of the local cached application data folder. Creates the sub-folder if it doesn't already exist. This is designed for large data caches that you would not want to roam from machine to machine in a roaming profiles environment on Windows, and for data that can be easily regenerated if deleted. On Windows XP, for example, this might return: "%USERHOME%\Local Settings\Application Data\Adobe\InDesign\Version x.y\en_US\Caches\subFolderName" On Macintosh, for example, this might return: "~/Library/Caches/Adobe InDesign/Version x.y/en_US/subFolderName"
| result | OUT IDFile of the sub folder within the local cached data folder. |
| subFolderName | IN Subfolder within the local cached data folder to return. |
| static |
Get the local cached application data folder without the locale sub-folder. This function does not create the data folder.
| result | OUT IDFile of the folder. |
| static |
Finds a specified sub-folder of the roaming application data folder. Creates the sub-folder if it doesn't already exist. This is designed for "normal" preference data that you would want to roam from machine to machine in a roaming profiles environment on Windows. On Windows XP, for example, this might return: "%USERHOME%\Application Data\Adobe\InDesign\Version x.y\en_US\subFolderName" On Macintosh, for example, this might return: "~/Library/Preferences/Adobe InDesign/Version x.y/en_US/subFolderName"
| result | OUT IDFile of the sub folder within the roaming data folder. |
| subFolderName | IN Subfolder within the roaming data folder to return. |
| static |
Returns the directory separator in type PMString
| static |
Returns the Mac directory separator in type char
| static |
Returns the Mac directory separator in type PMString
| static |
Returns the Mac directory separator in type textChar
| static |
Returns the Mac Path-Style
| static |
Internal use only Returns the Posix-Style directory separator in type char
| static |
Internal use only Returns the Posix-Style directory separator in type PMString
| static |
Internal use only Returns the Posix-Style directory separator in type textChar
| static |
Return the presets folder with a subfolder appended, and optionally a localized folder appended as well. If you need just the Presets directory, you can pass an empty subFolderName and PMLocaleId().
| folder | IN/OUT the output path to a location within the Presets folder |
| subFolderName | IN An optional subfolder with the Presets folder to append to the output path. May pass an empty string if not needed. |
| localeId | IN Will append a localized folder name (e.g. "en_US") depending on PMLocaleId passed in. Typically LocaleSetting::GetLocale() is passed for this argument. However, you can pass an default PMLocaleId() if you want no localized folder appended. |
Converts an IDFile to a system path string.
| file | IN IDFile to convert to a string. |
| pathStr | OUT Resulting path string.\ On Windows, the path is a UNC or local path: "C:\My Programs\adobe\indesign.exe".\ On the mac, the path is an POSIX path: "/Applications/Adobe InDesign CS2". |
| static |
Checks if the file is a temporary file.
| static |
Checks if the file is an InDesign Template file.
| static |
Opens the file.
| file | IN File to open. |
| mode | IN Flags denoting type of access permitted (see fopen). |
| static |
Opens the file referenced by the path.
| file | IN Path of file to open. An POSIX path on Mac. |
| mode | IN Flags denoting type of access permitted (see fopen). |
| static |
Opens the file referenced by the path.
| file | IN Path of file to open. An POSIX path on Mac. |
| mode | IN Flags denoting type of access permitted (see fopen). |
Convert from a fully qualified path name to a standard file URL (file://).
| fileName | On the PC the filename string will be a system path like "C:\my programs\adobe\indesign.exe" or a UNC path like "\\myServer\mydir\myfile.txt" on the mac the string will be a path made up of FSspec path names (31 byte limit), this path might not look quite correct but it should be in platform encodeing mac path: "/Applications/Adobe/InDesign CS" DON"T PASS RAW UTF16 in here! |
Converts from a system path string to an IDFile.
| pathStr | IN String containing the path to convert to an IDFile.\ On Windows, the path is a UNC or local path: "C:\My Programs\adobe\indesign.exe".\ On the Mac, the path is an POSIX path: "/Applications/Adobe InDesign CS2". |
| file | OUT Resulting IDFile object. |
Converts from a system path string to an IDFile.
| pathStr | IN String containing the path to convert to an IDFile.\ On Windows, the path is a UNC or local path: "C:\My Programs\adobe\indesign.exe".\ On the Mac, the path is an POSIX path: "/Applications/Adobe InDesign CS2". |
Converts a string into URL encodeing, basicly does a PMString->UTF8Encodeing->URLEncodeing
| str | the string to convert into URL encodeing |
PrefixFileURL appends a prefix string after the file:/// or file:// in a file url. This function serves really no purpose other then being a helper function to some junky code thrown around PLEASE don't use this.. It should really go away in the next version...
If a file url isn't passed in then this code will assert, and the url will be returned.
Example: PrefixFileURL ("123","file://myfile.jpg") == file://123myfile.jpg PrefixFileURL ("123","file:///myfile.jpg") == file:///123myfile.jpg PrefixFileURL ("123","file:////myfile.jpg") == file:///123/myfile.jpg PrefixFileURL ("123","file:/myfile.jpg") == ASSERT + file:/myfile.jpg PrefixFileURL ("123","http://myfile.jpg") == ASSERT + http://myfile.jpg
| prefix | prefix to append |
| fileURL | file url to add the prefix to. |
Convert from a IDFile to a standard file URL.
| fSpec | a IDFile (System specifc file system path on the mac this is a wrapper around the FSSpec on the PC its a standard path). The PC can point to eather a local file("c:\mydir\myfile") or a file on a remote host ("\\myhost\mydir\myfile"). On the Mac all remote files are accessed via mounted volumes so all SysFiles are local |
Converts an IDFile to a system path string.
| file | IN IDFile to convert to a string. |
| static |
URLToPMString takes a URL and decodes it and returns the string this function is basilcy URLToUTF8Encodeing and then a UTF8EncodeingToWideString. The second transformation is only done if needed Note any part of a URL can be passed in.
| URL | string to convert from URL encodeing to a string |
| static |
URLToUTF8 converts from a URL to UTF8 encoded string
| fileURL | is the URL to convert |
| ContainsUTF16 | is a flag set if the returned UTF8 string encodes UTF16 chars |
| static |
UTF8ToURL converts from a UTF8 encoded string to a URLencoded string
| str | is the UTF8 encoded string |
| kSeparator | is file seperator in the UTF8 str, the file seperator will be converted to a url seperator '/' if no conversion is desired then '/' should be passed in. If a PC path was being sent in, in a UTF8 encodeing then the seperator would be '\', if a mac posix path was being sent in the seperator would be '/' |