HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DS_Creator.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: DS_Creator.h ( vexds Library, C++)
7  *
8  * COMMENTS: Writes dialog scripts according to the parameter
9  * information obtained from a DS_ParmReader object
10  */
11 
12 #ifndef __DS_Creator__
13 #define __DS_Creator__
14 
15 #include "PRM_API.h"
16 #include <iosfwd>
17 #include <UT/UT_String.h>
18 #include <UT/UT_StringArray.h>
19 #include "DS_ParmReader.h"
20 
21 class DS_SelectorBinding;
22 
23 #define DS_DEFNAME "DScreator"
24 #define DS_DEFDIR "."
25 
27 {
28 public:
30  const char *appName = DS_DEFNAME );
31  virtual ~DS_Creator();
32 
33  int openOutput( std::ostream &os );
34  int closeOutput();
35 
36  int prepareToWriteOutput();
37  int writeOutput();
38 
39  void setParmDSOverride(const char *parm_ds)
40  { myParmDSOverride.harden(parm_ds); }
41 
42  static void setUseOldGrouping(bool useold);
43  static bool getUseOldGrouping();
44 
45  /// Returns an indentation string for the given indent level.
46  ///
47  /// The string is kept in a static buffer, which has the advantage of
48  /// automatically caching it, but you are thus meant to call getIndent
49  /// pretty much every time you want to indent something
50  static const char *getIndent(int level);
51 
52  static const char *theToolboxLabels[];
53 
54  static void dumpParm(const DS_ParmInfo *pi);
55 
56 protected:
57  void writeUnboundSelectors(DS_SelectorList &selectors);
58  void writeReservedSelectors(DS_SelectorList &selectors);
59  void writeReservedHandles(DS_HandleList &handles);
60  void writeBoundHandles(DS_HandleList &handles);
61  void writeMetaInfo();
62  void writeParms() const;
63  virtual void writeContextSpecific();
64  virtual int writeInfo();
65  virtual void writeHeader(const char *appname, const char *script);
66  virtual void writeTrailer(const char *appname, const char *script);
67 
68  static void startGroup(std::ostream &os, int &id, const char *name);
69  static void printParm(std::ostream &os, const DS_ParmInfo *pi);
70 
71  static void printHelp( std::ostream &os, const char *help );
72  static void printInfo( std::ostream &os, const char *info );
73 
76  std::ostream *myOS;
78 
80  static bool theUseOldGrouping;
81 };
82 
83 #endif
UT_String myParmDSOverride
Definition: DS_Creator.h:77
DS_ParmReader & myPR
Definition: DS_Creator.h:74
#define DS_DEFNAME
Definition: DS_Creator.h:23
GLint level
Definition: glcorearb.h:108
std::string help(const App *app, const Error &e)
Printout the full help string on error (if this fn is set, the old default for CLI11) ...
Definition: CLI11.h:8978
static bool theUseOldGrouping
Definition: DS_Creator.h:80
UT_String myAppName
Definition: DS_Creator.h:75
static UT_StringArray theGroupStack
Definition: DS_Creator.h:79
GLuint const GLchar * name
Definition: glcorearb.h:786
std::ostream * myOS
Definition: DS_Creator.h:76
void setParmDSOverride(const char *parm_ds)
Definition: DS_Creator.h:39
constexpr T pi()
Pi constant taken from Boost to match old behaviour.
Definition: Math.h:119
#define PRM_API
Definition: PRM_API.h:10