WhipExamples/FileWrite.cpp

00001 //
00002 //  Copyright (c) 2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
00008 //  AS TO THE CORRECTNESS OF THIS CODE OR ANY DERIVATIVE
00009 //  WORKS WHICH INCORPORATE IT.
00010 //
00011 //  AUTODESK PROVIDES THE CODE ON AN "AS-IS" BASIS
00012 //  AND EXPLICITLY DISCLAIMS ANY LIABILITY, INCLUDING
00013 //  CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00014 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00015 //
00016 //  Use, duplication, or disclosure by the U.S. Government is subject to
00017 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00018 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00019 //  Data and Computer Software), as applicable.
00020 //
00021 
00022 #include "whiptk/whip_toolkit.h"
00023 #include "whiptk/w2d_class_factory.h"
00024 
00025 void FileWrite(const WT_String& filename)
00026 {
00027     WT_W2D_Class_Factory cf;
00028     WT_File        *whip_file = cf.Create_File();
00029     
00030     //Set the filename and open mode.    
00031     whip_file->set_filename (filename);
00032     whip_file->set_file_mode (WT_File::File_Write);
00033     //Set a different target version here if you don't want the current file version... for example:
00034     //whip_file->heuristics().set_target_version(42); //produce a DWF ver 00.42
00035 
00036     if (WT_Result::Success == whip_file->open())
00037     {
00038         //Set the binary data and compression settings.
00039         whip_file->heuristics().set_allow_binary_data(true);
00040         whip_file->heuristics().set_allow_data_compression(true);
00041 
00042         //Write file data.
00043 
00044         whip_file->close();
00045     }
00046     
00047     cf.Destroy(whip_file);
00048 }

Generated on Tue Jan 6 22:41:12 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5