class doc strings

This commit is contained in:
David Rose 2005-09-10 00:02:12 +00:00
parent 59ceb897ed
commit f2d34a6022
3 changed files with 388 additions and 390 deletions

View File

@ -42,7 +42,7 @@ extern std::string EXPORT_IMPORT_PREFEX;
#define CLASS_PREFEX "Dtool_"
#define INSTANCE_PREFEX "Dtool_"
#define BASE_INSTANCE_NAME "Dtool_PyInstDef"
#define MAX_COMMENT_SIZE 1024
#define MAX_COMMENT_SIZE 6144
/////////////////////////////////////////////////////////
@ -323,10 +323,8 @@ std::string methodNameFromCppName(std::string cppName, const std::string &class
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
std::string make_safe_comment(const std::string & name_in)
{
std::string
make_safe_comment(const std::string & name_in) {
std::string name(name_in.substr(0,MAX_COMMENT_SIZE));
static const char safe_chars2[] = ",.[](){}:;'`~!@#$%^&*+\\=/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_- ";
@ -1149,9 +1147,8 @@ bool GetSlotedFunctinDef(const std::string &thimputstring, std::string &answer_l
/////////////////////////////////////////////////////////////////////////////////////////////
// Function :write_module_class
/////////////////////////////////////////////////////////////////////////////////////////////
void InterfaceMakerPythonNative::write_module_class(ostream &out, Object *obj)
{
void InterfaceMakerPythonNative::
write_module_class(ostream &out, Object *obj) {
bool has_local_hash = false;
bool has_local_repr = false;
bool has_local_str = false;
@ -1422,7 +1419,15 @@ void InterfaceMakerPythonNative::write_module_class(ostream &out, Object *obj)
// out << " memset(Dtool_"<< ClassName << ".As_PyTypeObject().tp_as_mapping,0,sizeof(PyMappingMethods));\n";
// out << " static Dtool_PyTypedObject *InheritsFrom[] = {";
// add doc string
if (obj->_itype.has_comment()) {
out << "#ifndef NDEBUG\n";
out << " // Class documentation string\n";
out << " Dtool_" << ClassName
<< ".As_PyTypeObject().tp_doc = \""
<< make_safe_comment(obj->_itype.get_comment()) << "\";\n";
out << "#endif\n";
}
// add bases///
if(bases.size() > 0)

View File

@ -58,12 +58,6 @@ void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject *
answer = NULL;
};
void *
DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef) {
return DTOOL_Call_GetPointerThisClass(self, classdef, 0, "unknown");
}
void *
DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef,
int param, const string &function_name) {

View File

@ -304,7 +304,6 @@ EXPCL_DTOOLCONFIG bool DtoolCanThisBeAPandaInstance(PyObject *self);
EXPCL_DTOOLCONFIG void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject * classdef, void ** answer);
EXPCL_DTOOLCONFIG void * DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef);
EXPCL_DTOOLCONFIG void * DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, int param, const string &function_name);
EXPCL_DTOOLCONFIG void * DTOOL_Call_GetPointerThis(PyObject *self);