00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Jeff Lait 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: CH_WriteCode.h ( CH Library, C++) 00015 * 00016 * COMMENTS: 00017 * Writes the C++ code to implement a channel... 00018 * This is designed to be overloaded where necessary to customize 00019 * it for specific environments (such as inside a POP) 00020 */ 00021 00022 #ifndef __CH_WriteCode__ 00023 #define __CH_WriteCode__ 00024 00025 #include "CH_API.h" 00026 00027 class CH_API CH_WriteCode 00028 { 00029 public: 00030 CH_WriteCode(); 00031 virtual ~CH_WriteCode(); 00032 00033 // os is output stream to write the new function call. gs is 00034 // the global stream to put the data. 00035 // prefix is the file level prefix, a channel specific name 00036 // will be appended. 00037 // Force type is one of CH_ChannelBehavior. -1 doesn't cause 00038 // any forcing to occur. 00039 int writeCode(CH_Channel *chan, ostream &os, ostream &gs, 00040 const UT_String &prefix, 00041 const UT_String &mainprefix, int isstatic = 1, 00042 int forcetype = -1); 00043 00044 // This function expands expressions: 00045 virtual void expandExpression(UT_String &expr); 00046 00047 // These mark the start and end of each call back functions expandExpression 00048 // region. They both write BEFORE the result of expandExpression 00049 // is written. 00050 virtual void startExpressionBlock(ostream &gs); 00051 virtual void stopExpressionBlock(ostream &gs); 00052 00053 static void writeChannelType(ostream &os, CH_ChannelBehavior type); 00054 00055 // Writes a proper C++ float with the "F" qualifier. 00056 static void writeFloat(ostream &os, float val); 00057 00058 protected: 00059 // Duplicate from OP_Node :< 00060 int myTabSpace; 00061 void writeIndent(ostream &os, int level); 00062 void writeSpaces(ostream &os, int spaces); 00063 }; 00064 00065 #endif 00066
1.5.9