InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SDKUtilities.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Adobe Developer Technologies
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __SDKUtilities_h__
25 #define __SDKUtilities_h__
26 
27 #include "IPMStream.h"
28 
29 #ifdef ID_DEPRECATED
30 
36 class SDKUtilities
37 {
38  public:
39 
41  SDKUtilities() { };
42 
48  static void InvokePlugInAboutBox(const PMString alertStringID);
49 
50  // The next set of methods allow for the manipulation of string filenames:
51 
57  static void GetPathName(const IDFile spec, PMString &name);
58 
67  static bool IsAbsolutePath(PMString thisString);
68 
77  static bool IsUnixPath(PMString thisstring);
78 
87  static bool IsMacPath(PMString thisstring);
88 
97  static bool IsWinPath(PMString thisstring);
98 
105  static void RemoveLastElement(PMString& fromthis);
106 
113  static void RemoveFirstElement(PMString& fromthis);
114 
124  static ErrorCode ToAbsolutePath(PMString base, PMString path, PMString& out);
125 
135  static ErrorCode ToAbsolutePath(IDFile base, PMString path, IDFile& out);
136 
146  static void convertToMacPath(PMString& thisstring);
147 
153  static void convertToWinPath(PMString& thisstring);
154 
159  static PMString SysFileToPMString(const IDFile* sFile);
160 
165  static IDFile PMStringToSysFile(PMString* fileName);
166 
167  /* dumps to trace (notepad on win, DebugWindow on mac) information about the boss class.
168 
169  Obsoleted. You may consult the implementation code for reference.
170  @param for_this_if defines an interface on the boss class of interest.
171  */
172  static void DumpBoss(IPMUnknown * for_this_if);
173 
180  static void DumpBoss(UIDRef for_this_object);
181 
195  static void DumpMessage(const char* msg, const ClassID& theChange, const PMIID& protocol);
196 
205  static void Replace(
206  PMString& original,
207  const PMString& target,
208  const PMString& replace
209  );
210 
215  static ErrorCode GetApplicationFolder(PMString& appFolder);
216 
221  static ErrorCode AbsolutePathToSysFile(PMString path, IDFile& out);
222 
227  static IPMStream* CreateFileStreamRead(
228  const PMString& fullPath,
229  uint32 mode = kOpenIn,
230  OSType fileType = 0x3f3f3f3f,
231  OSType creator = 0x3f3f3f3f
232  );
233 
238  static IPMStream* CreateFileStreamWrite(
239  const PMString& fullPath,
240  uint32 mode = kOpenOut|kOpenTrunc,
241  OSType fileType = 'TEXT',
242  OSType creator = 'CWIE'
243  );
244 
250  static ErrorCode FileExistsForRead(const PMString& fullPath);
251 
256  static void AppendPathSeparator(PMString& path);
257 
265  static void GetFileCreatorType(const IDFile spec, SysOSType* fileType, SysOSType* creator);
266 
272  static PMString GetExtension(const IDFile spec);
273 };
274 #endif // ID_DEPRECATED
275 
276 #endif // __SDKUtilities_h__
277 
278 // End, SDKUtilities.h.
279 
280