Browse Source

Add wstring type handle. Also add some useful MAKE_SEQs.

rdb 11 years ago
parent
commit
cba254d0bc

+ 2 - 2
dtool/src/dtoolbase/register_type.cxx

@@ -26,6 +26,7 @@ TypeHandle bool_type_handle;
 TypeHandle double_type_handle;
 TypeHandle float_type_handle;
 TypeHandle string_type_handle;
+TypeHandle wstring_type_handle;
 
 TypeHandle long_p_type_handle;
 TypeHandle int_p_type_handle;
@@ -58,6 +59,7 @@ void init_system_type_handles() {
     register_type(double_type_handle, "double");
     register_type(float_type_handle, "float");
     register_type(string_type_handle, "string");
+    register_type(wstring_type_handle, "wstring");
 
     register_type(int_p_type_handle, "int*");
     register_type(short_p_type_handle, "short*");
@@ -75,5 +77,3 @@ void init_system_type_handles() {
     register_type(pset_type_handle, "pset");
   }
 }
-
-

+ 6 - 0
dtool/src/dtoolbase/register_type.h

@@ -92,6 +92,7 @@ extern TypeHandle EXPCL_DTOOL bool_type_handle;
 extern TypeHandle EXPCL_DTOOL double_type_handle;
 extern TypeHandle EXPCL_DTOOL float_type_handle;
 extern TypeHandle EXPCL_DTOOL string_type_handle;
+extern TypeHandle EXPCL_DTOOL wstring_type_handle;
 
 extern TypeHandle long_p_type_handle;
 extern TypeHandle int_p_type_handle;
@@ -175,6 +176,11 @@ INLINE TypeHandle _get_type_handle(const string *) {
   return string_type_handle;
 }
 
+template<>
+INLINE TypeHandle _get_type_handle(const wstring *) {
+  return wstring_type_handle;
+}
+
 template<>
 INLINE TypeHandle _get_type_handle(const long * const *) {
   return long_p_type_handle;

+ 2 - 0
dtool/src/dtoolbase/typeRegistry.h

@@ -58,9 +58,11 @@ PUBLISHED:
 
   int get_num_typehandles();
   TypeHandle get_typehandle(int n);
+  MAKE_SEQ(get_typehandles, get_num_typehandles, get_typehandle);
 
   int get_num_root_classes();
   TypeHandle get_root_class(int n);
+  MAKE_SEQ(get_root_classes, get_num_root_classes, get_root_class);
 
   int get_num_parent_classes(TypeHandle child,
                              TypedObject *child_object) const;

+ 4 - 0
dtool/src/prc/configVariableCore.h

@@ -66,15 +66,19 @@ PUBLISHED:
   bool has_value() const;
   int get_num_declarations() const;
   const ConfigDeclaration *get_declaration(int n) const;
+  MAKE_SEQ(get_declarations, get_num_declarations, get_declaration);
 
   INLINE int get_num_references() const;
   INLINE const ConfigDeclaration *get_reference(int n) const;
+  MAKE_SEQ(get_references, get_num_references, get_reference);
 
   INLINE int get_num_trusted_references() const;
   INLINE const ConfigDeclaration *get_trusted_reference(int n) const;
+  MAKE_SEQ(get_trusted_references, get_num_trusted_references, get_trusted_reference);
 
   INLINE int get_num_unique_references() const;
   INLINE const ConfigDeclaration *get_unique_reference(int n) const;
+  MAKE_SEQ(get_unique_references, get_num_unique_references, get_unique_reference);
 
   void output(ostream &out) const;
   void write(ostream &out) const;

+ 1 - 0
dtool/src/prc/configVariableManager.h

@@ -47,6 +47,7 @@ PUBLISHED:
 
   INLINE int get_num_variables() const;
   INLINE ConfigVariableCore *get_variable(int n) const;
+  MAKE_SEQ(get_variables, get_num_variables, get_variable);
   string get_variable_name(int n) const;
   bool is_variable_used(int n) const;