Adobe.com
Contents Suites Classes Class Index Member Index

SPFiles.h

Go to the documentation of this file.
00001 /***********************************************************************/
00002 /*                                                                     */
00003 /* SPFiles.h                                                           */
00004 /*                                                                     */
00005 /* ADOBE SYSTEMS INCORPORATED                                          */
00006 /* Copyright 1995-2007 Adobe Systems Incorporated.                     */
00007 /* All Rights Reserved.                                                */
00008 /*                                                                     */
00009 /* NOTICE:  Adobe permits you to use, modify, and distribute this file */
00010 /* in accordance with the terms of the Adobe license agreement         */
00011 /* accompanying it. If you have received this file from a source other */
00012 /* than Adobe, then your use, modification, or distribution of it      */
00013 /* requires the prior written permission of Adobe.                     */
00014 /*                                                                     */
00015 /* Patents Pending                                                     */
00016 /*                                                                     */
00017 /*                                                                     */
00018 /***********************************************************************/
00019 
00020 #ifndef __SPFiles__
00021 #define __SPFiles__
00022 
00023 
00024 /*******************************************************************************
00025  **
00026  **     Imports
00027  **
00028  **/
00029 
00030 #include "SPTypes.h"
00031 #include "SPProps.h"
00032 
00033 #include "SPHeaderBegin.h"
00034 
00035 #ifdef WIN_ENV
00036 #include <cstring>
00037 #endif
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042     
00043     
00044     /*******************************************************************************
00045      **
00046      ** Constants
00047      **
00048      **/
00050 #define kSPFilesSuite                           "SP Files Suite"
00051     
00052     
00053 #define kSPFilesSuiteVersion3           3
00054     
00055 #define kSPFilesSuiteVersion            4
00056 
00058 #define kSPRuntimeFileList                      ((SPFileListRef)NULL)
00059     
00060     
00063 #define kFileDoesNotHavePiPL            (SPPropertyListRef)(~((size_t)NULL))
00064 
00068 #define kFileHasMulitplePiPLs           NULL
00069     
00070     /*******************************************************************************
00071      **
00072      ** Types
00073      **
00074      **/
00075     
00080     typedef struct SPFile *SPFileRef;
00082     typedef struct SPFileList *SPFileListRef;
00084     typedef struct SPFileListIterator *SPFileListIteratorRef;
00086     typedef struct OpaqueSPPlatformFileRef SPPlatformFileRef;
00087     
00088     
00089 #ifdef MAC_ENV
00090 #define kMaxPathLength 1024
00091 #pragma options align=power
00092     
00093     
00095     typedef struct SPPlatformFileSpecification {
00097         short vRefNum;
00099         ai::int32 parID;
00101         unsigned char name[64];
00102     } SPPlatformFileSpecification;
00103         
00106     typedef struct SPPlatformFileReference {
00107         unsigned char path[kMaxPathLength]; //1024 has been taken up from /usr/include/sys/syslimits.h
00108     } SPPlatformFileReference;
00109     
00110 #pragma options align=reset
00111     
00113     typedef struct SPPlatformFileInfo {  /* On Mac OS*/
00115         ai::uint32 attributes;  //Unused, but still required to maintain binary compatibility
00117         ai::uint32 creationDate;
00119         ai::uint32 modificationDate;
00121         ai::uint32 finderType;
00123         ai::uint32 finderCreator;
00125         ai::uint16 finderFlags;
00126     } SPPlatformFileInfo;
00127     
00128     SPErr FileSpectoFileRef(const SPPlatformFileSpecification *fileSpec, const SPPlatformFileReference *fileRef); // temporary functions used while transition from SPPlatformFileSpecification to SPPlatformFileReference
00129     SPErr FileReftoFileSpec(const SPPlatformFileReference *fileRef, const SPPlatformFileSpecification *fileSpec);
00130 #endif
00131     
00132 #ifdef WIN_ENV
00133 #define kMaxPathLength 300
00134 
00135     typedef struct SPPlatformFileSpecification {
00137         char path[kMaxPathLength];
00138     } SPPlatformFileSpecification;
00139     
00140     //Keeping the structure's type similar to PSinterface, added some additional helper methods.
00141     struct SPPlatformFileSpecificationW {
00142     private:
00144         wchar_t path[kMaxPathLength];
00145     public:
00146         SPPlatformFileSpecificationW()
00147         {
00148             memset (path,0,sizeof(path));
00149         }
00150         const wchar_t* c_str() const { return path; }
00151         
00152         wchar_t* GetBuffer() {return path;}
00153     };
00154     
00160     typedef SPPlatformFileSpecificationW SPPlatformFileReference;
00161     
00163     typedef struct SPPlatformFileInfo {
00165         ai::uint32 attributes;
00167         ai::uint32 lowCreationTime;
00169         ai::uint32 highCreationTime;
00171         ai::uint32 lowModificationTime;
00173         ai::uint32 highModificationTime;
00175         const wchar_t* extension;
00176     } SPPlatformFileInfo;
00177 #endif
00178     
00180     typedef SPBoolean (*SPAddPiPLFilterProc)( SPPlatformFileInfo *info );
00181     
00182     
00183     /*******************************************************************************
00184      **
00185      ** Suite
00186      **
00187      **/
00204     typedef struct SPFilesSuite {
00211         SPAPI SPErr (*AllocateFileList)( SPFileListRef *fileList );
00215         SPAPI SPErr (*FreeFileList)( SPFileListRef fileList );
00216         
00222                 SPAPI SPErr (*AddFiles)( SPFileListRef fileList, const SPPlatformFileReference *file );
00223                 
00224         
00231         SPAPI SPErr (*NewFileListIterator)( SPFileListRef fileList, SPFileListIteratorRef *iter );
00237         SPAPI SPErr (*NextFile)( SPFileListIteratorRef iter, SPFileRef *file );
00241         SPAPI SPErr (*DeleteFileListIterator)( SPFileListIteratorRef iter );
00247 #ifdef WIN_ENV
00248         
00249         SPAPI SPErr (*GetFileSpecification) ( SPFileRef  file, SPPlatformFileSpecification *fileSpec );
00250 #endif
00251         SPAPI SPErr (*GetFileReference)( SPFileRef file, SPPlatformFileReference *fileSpec );
00256         SPAPI SPErr (*GetFileInfo)( SPFileRef file, SPPlatformFileInfo *info );
00257         
00262         SPAPI SPErr (*GetIsAPlugin)( SPFileRef file, SPBoolean *isAPlugin );
00267         SPAPI SPErr (*SetIsAPlugin)( SPFileRef file, SPBoolean isAPlugin );
00268         
00276         SPAPI SPErr (*GetFilePropertyList)( SPFileRef file, SPPropertyListRef *propertList );
00281         SPAPI SPErr (*SetFilePropertyList)( SPFileRef file, SPPropertyListRef propertList );
00282         
00283     } SPFilesSuite;
00284     
00285     
00287     SPAPI SPErr SPAllocateFileList( SPFileListRef *fileList );
00289     SPAPI SPErr SPFreeFileList( SPFileListRef fileList );
00290     SPAPI SPErr SPAddFiles( SPFileListRef fileList, const SPPlatformFileReference *file );
00291     
00293     SPAPI SPErr SPNewFileListIterator( SPFileListRef fileList, SPFileListIteratorRef *iter );
00295     SPAPI SPErr SPNextFile( SPFileListIteratorRef iter, SPFileRef *file );
00297     SPAPI SPErr SPDeleteFileListIterator( SPFileListIteratorRef iter );
00298     
00300 #ifdef WIN_ENV
00301     
00302     SPAPI SPErr SPGetFileSpecification( SPFileRef  file, SPPlatformFileSpecification *fileSpec );
00303 #endif
00304     
00305     SPAPI SPErr SPGetFileReference( SPFileRef file, SPPlatformFileReference *fileSpec ); // This function will replace all the instances of SPGetFileSpecification
00307     SPAPI SPErr SPGetFileInfo( SPFileRef file, SPPlatformFileInfo *info );
00309     SPAPI SPErr SPGetIsAPlugin( SPFileRef file, SPBoolean *isAPlugin );
00311     SPAPI SPErr SPSetIsAPlugin( SPFileRef file, SPBoolean isAPlugin );
00312     
00314     SPAPI SPErr SPGetFilePropertyList( SPFileRef file, SPPropertyListRef *propertList );
00316     SPAPI SPErr SPSetFilePropertyList( SPFileRef file, SPPropertyListRef propertList );
00317     
00319     SPAPI SPErr SPAddFilePiPLs( SPFileListRef fileList, SPAddPiPLFilterProc filter );
00320     
00321     /*******************************************************************************
00322      **
00323      ** Errors
00324      **
00325      **/
00326     
00327 #include "SPErrorCodes.h"
00328     
00329 #ifdef __cplusplus
00330 }
00331 #endif
00332 
00333 #include "SPHeaderEnd.h"
00334 
00335 #endif


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2016 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks