This API is used to support OLE structured storage streams containing user specified string data in 3ds Max scene files or other OLE Structured Storage based files.
More...
|
DllExport bool | DoesCustomFileStreamStorageExist (const wchar_t *fileName) |
| Checks if a file exists and contains a storage called CustomFileStreamDataStorage. More...
|
|
DllExport IStorage * | OpenStorageForWrite (const wchar_t *fileName, IStorage *&pFileIStorage) |
| Open a file as an OLE structured storage file with read/write access. More...
|
|
DllExport IStorage * | OpenStorageForRead (const wchar_t *fileName, IStorage *&pFileIStorage) |
| Open a file as an OLE structured storage file with read access. More...
|
|
DllExport IStream * | OpenStreamForWrite (IStorage *pIStorage, const wchar_t *streamName, DWORD privateFlags, DWORD publicFlags=0, WORD version=kCustomFileStreamVersion) |
| Open a stream with read/write access, creating it if not present. More...
|
|
DllExport IStream * | OpenStreamForRead (IStorage *pIStorage, const wchar_t *streamName) |
| Open a stream with read access. More...
|
|
DllExport bool | ValidateStream (IStream *pIStream, CustomFileStreamHeader *stream_header=nullptr) |
| Validates that stream was created via CustomFileStream methods, captures private and public flag values if wanted, leaves IStream positioned immediately past header. More...
|
|
DllExport unsigned __int64 | GetStreamContentByteCount (IStream *pIStream) |
| Get the byte count of the content of the stream (the data past the header) More...
|
|
DllExport bool | SeekToStartOfStreamContent (IStream *pIStream) |
| Sets the stream position to the beginning of the content (the data past the header) More...
|
|
DllExport bool | IsStreamContentAnArray (IStream *pIStream) |
| Determine if stream content is an array of strings. More...
|
|
DllExport bool | ReadStreamContents (IStream *pIStream, std::wstring &content) |
| Read the stream contents (the data past the header). More...
|
|
DllExport bool | ReadStreamContents (IStream *pIStream, std::vector< std::wstring > &content) |
| Read the stream contents (the data past the header) More...
|
|
DllExport bool | WriteStreamContents (IStream *pIStream, const std::wstring &content) |
| Write the stream contents (the data past the header), erasing any previous content. More...
|
|
DllExport bool | WriteStreamContents (IStream *pIStream, const std::vector< std::wstring > &content) |
| Write the stream contents (the data past the header), erasing any previous content. More...
|
|
DllExport bool | GetStreamNames (IStorage *pIStorage, std::vector< std::wstring > &streamNames) |
| Read the CustomFileStream names. More...
|
|
DllExport kDeleteStream_result | DeleteFileStream (const wchar_t *fileName, const wchar_t *streamName) |
| Delete the specified CustomFileStream stream from the specified file. More...
|
|
DllExport kGetLastCharacterOfContent_result | GetLastCharacterOfContent (IStream *pIStream, wchar_t &theChar) |
| Get the last character of content in a stream. More...
|
|
This API is used to support OLE structured storage streams containing user specified string data in 3ds Max scene files or other OLE Structured Storage based files.
See https://msdn.microsoft.com/en-us/library/windows/desktop/aa380369(v=vs.85).aspx for a description of OLE Structured Storage. Within 3ds Max, this API is used by CustomFileStream.dlu and implemented by CustomFileStreamAPI.dll source. The source for these are in maxsdk\samples\utilities\CustomFileStream. CustomFileStream.dlu defines the CustomSceneStreamManager and CustomFileStream FPS (Function Publishing System) interfaces. CustomFileStreamAPI.dll defines the low level file access methods that are used by CustomFileStream.dlu, and can be used by external applications to read, write, and modify the CustomFileStream as supported by the CustomSceneStreamManager and CustomFileStream interfaces. To use this dll, you would link against CustomFileStreamAPI.lib in maxsdk\libs. There are no dependencies by CustomFileStreamAPI.dll on other 3ds Max dlls. To see how these low level methods should be tied together, see the CustomFileStream.dlu source. This API will read and write CustomFileStream to 3ds Max scene files written by any version of 3ds Max. The CustomSceneStreamManager is required to persist the custom data streams across scene file load and save operations. CustomFileStream as supported by CustomSceneStreamManager and CustomFileStream are located in the CustomFileStream IStorage of the 3ds Max scene file main IStorage. Each stream consists of a header consisting of a 1 WORD version number and two 32 bit DWORD values (see CustomFileStreamHeader below), followed by a non-null terminated wchar string or an array of null terminated wchar strings. The current version number is 1. The first 32 bit DWORD is considered private (flag bit usage defined by Autodesk) and the second is considered public (flag bit usage defined by the creator of the stream). Currently, bits 1 to 3 of the private DWORD are used. Bit 1 signifies that the stream is a persistent stream. When this bit is set, the CustomSceneStreamManager will write this stream to the scene file when the scene file is saved. This allows an CustomFileStream to be automatically persisted across a load/save operation. Bit 2 signifies that the stream is to be saved to the scene file when the scene file is saved, but the stream is not necessarily a persistent stream. This allows the user to add streams to CustomSceneStreamManager's cache and have those streams be written to the scene file. This bit is not persisted to the scene file, and is cleared when read from the scene file. Bit 3 signifies that the stream is not to be added to the CustomSceneStreamManager's cache when the scene file is loaded. If neither of the first 2 bits are set, CustomSceneStreamManager does not write this stream to the scene file when the scene file is saved. The content of the stream is considered to be an array of strings if the last character in the content is a null character (signifying an array of null terminated strings), otherwise the content is considered to be a single non-null terminated string,
Validates that stream was created via CustomFileStream methods, captures private and public flag values if wanted, leaves IStream positioned immediately past header.
Verifies the stream is long enough to contain the stream header data, that the header data was read successfully, and the version number is equal to or less than the current version number. After opening a stream, this function should be used to validate the stream before using other functions in this API on the stream.
- Parameters
-
pIStream | The IStream. |
stream_header | [out] If not null, will hold the stream header data that was read from the file. |
- Returns
- true if the stream appears to have been created via CustomFileStream methods.