00001 /*----------------------------------------------------------------------------+ 00002 | ___ _ _ | 00003 | / | | | | | | 00004 | / /| | __| | ___ | |__ ___ | 00005 | / /_| |/ _ |/ _ \| _ \ / _ \ | 00006 | / ___ | (_| | (_) | |_) | __/ | 00007 | /_/ |_|\__,_|\___/|____/ \___| | 00008 | | 00009 | | 00010 | ADOBE CONFIDENTIAL | 00011 | __________________ | 00012 | | 00013 | Copyright (c) 2003 - 2007, Adobe Systems Incorporated. | 00014 | All rights reserved. | 00015 | | 00016 | NOTICE: All information contained herein is, and remains the property | 00017 | of Adobe Systems Incorporated and its suppliers, if any. The intellectual | 00018 | and technical concepts contained herein are proprietary to Adobe Systems | 00019 | Incorporated and its suppliers and may be covered by U.S. and Foreign | 00020 | Patents, patents in process, and are protected by trade secret or | 00021 | copyright law. Dissemination of this information or reproduction of this | 00022 | material is strictly forbidden unless prior written permission is | 00023 | obtained from Adobe Systems Incorporated. | 00024 | | 00025 | Adobe Systems Incorporated 415.832.2000 | 00026 | 601 Townsend Street 415.832.2020 fax | 00027 | San Francisco, CA 94103 | 00028 | | 00029 +----------------------------------------------------------------------------*/ 00030 00031 00032 #pragma once 00033 00052 #include "FmsAdaptor.h" 00053 00054 class IFmsFileAdaptor; 00055 class IFmsFileResponse; 00056 class IFmsServerContext; 00057 00058 00082 extern "C" void FCExport FmsCreateFileAdaptor( 00083 IFmsServerContext* pServerCtx, 00084 IFmsFileResponse* pResponse, 00085 IFmsFileAdaptor*& pFileAdaptor ); 00086 00101 extern "C" void FCExport FmsDestroyFileAdaptor( 00102 IFmsFileAdaptor* pFileAdaptor ); 00103 00104 00113 struct FmsFileAttribute 00114 { 00124 enum Type { 00125 kAll, 00126 kTimeCreated, 00127 kTimeModified, 00128 kTimeAccessed, 00129 kSize 00130 }; 00131 00135 int attr; 00136 00140 FmsVariant value; 00141 }; 00142 00143 00154 class IFmsFileAdaptor 00155 { 00156 public: 00167 enum RemoveFlags 00168 { 00169 kFile = 0, 00170 kDirs = 0x01, 00171 kSubDirs = 0x02, 00172 kEmptyDirs = 0x04, 00173 kWildCards = 0x08, 00174 00175 }; 00176 00177 00218 virtual int open( 00219 const char* sFileName, 00220 int iFlags, 00221 int iMode, 00222 int* pAttrKeys, 00223 int nAttrs, 00224 void* pCtx ) = 0; 00225 00226 00261 virtual int getAttributes( 00262 const char* sFileName, 00263 int* pAttrKeys, 00264 int nAttrs, 00265 void* pCtx ) = 0; 00266 00267 00299 virtual int getAttributes( 00300 int iHandle, 00301 int* pAttrKeys, 00302 int nAttrs, 00303 void* pCtx ) = 0; 00304 00305 00335 virtual int read( 00336 int iHandle, 00337 I64 uOffset, 00338 char* pBuffer, 00339 int nBytes, 00340 void* pCtx ) = 0; 00341 00342 00368 virtual int write( 00369 int iHandle, 00370 I64 uOffset, 00371 char* pBuffer, 00372 int nBytes, 00373 void* pCtx ) = 0; 00374 00390 virtual int close( int iHandle, void* pCtx ) = 0; 00391 00392 00416 virtual int remove( 00417 const char* sFileName, 00418 unsigned long uFlags, 00419 void* pCtx ) = 0; 00420 00438 virtual int createDir( 00439 const char* sFileName, 00440 void* pCtx ) = 0; 00441 00442 00443 virtual ~IFmsFileAdaptor() {} 00444 }; 00445 00460 class IFmsFileResponse 00461 { 00462 public: 00463 enum { 00467 kSystemErrors = 0x0000ffff, // Mask to extract system error 00471 kVendorError = 0xffff0000, // Mask to extract vendor error 00475 kUnimplemented = 1, // Unimplemented API call 00479 kInvalidHandle = 2 // Invalid handle 00480 }; 00481 00482 00508 virtual void onOpen( 00509 U32 uStatus, 00510 int iHandle, 00511 FmsFileAttribute* pAttrs, 00512 int nAttrs, 00513 void *pCtx ) = 0; 00514 00515 00537 virtual void onGetAttributes( 00538 U32 uStatus, 00539 FmsFileAttribute* pAttrValues, 00540 int nAttrs, 00541 void* pCtx ) = 0; 00542 00543 00566 virtual void onRead( U32 uStatus, void* pBuffer, int nBytes, void* pCtx ) = 0; 00567 00586 virtual void onWrite( U32 uStatus, int nBytes, void* pCtx ) = 0; 00587 00588 00603 virtual void onClose( U32 uStatus, void* pCtx ) = 0; 00604 00605 00620 virtual void onRemove( U32 uStatus, void* pCtx ) = 0; 00621 00636 virtual void onCreateDir( U32 uStatus, void* pCtx ) = 0; 00637 00638 00639 virtual ~IFmsFileResponse() {} 00640 }; 00641
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flashmediaserver/3.0/plugin_apiref/html/_fms_file_adaptor_8h-source.html