MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / dumpVariable

Function dumpVariable

Engine/source/console/engineDoc.cpp:111–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111static void dumpVariable( Stream& stream,
112 Dictionary::Entry* entry,
113 const char* inClass = NULL )
114{
115 // Skip variables defined in script.
116
117 if( entry->type <= Dictionary::Entry::TypeInternalString )
118 return;
119
120 // Skip internals... don't export them.
121 if ( entry->mUsage &&
122 ( dStrstr( entry->mUsage, "@hide" ) || dStrstr( entry->mUsage, "@internal" ) ) )
123 return;
124
125 // Split up qualified name.
126
127 Vector< String > nameComponents;
128 String( entry->name ).split( "::", nameComponents );
129 if( !nameComponents.size() ) // Safety check.
130 return;
131
132 // Match filter.
133
134 if( inClass )
135 {
136 // Make sure first qualifier in name components is a
137 // namespace qualifier matching the given class name.
138
139 if( nameComponents.size() <= 1 || dStricmp( nameComponents.first().c_str() + 1, inClass ) != 0 ) // Skip '$'.
140 return;
141 }
142 else
143 {
144 // Make sure, this is *not* in a class namespace.
145
146 if( nameComponents.size() > 1 && Con::lookupNamespace( nameComponents.first().c_str() + 1 )->mClassRep )
147 return;
148 }
149
150 // Skip variables for which we can't decipher their type.
151
152 ConsoleBaseType* type = ConsoleBaseType::getType( entry->type );
153 if( !type )
154 {
155 Con::errorf( "Can't find type for variable '%s'", entry->name );
156 return;
157 }
158
159 // Write doc comment.
160
161 stream.writeText( "/*!\r\n" );
162
163 if( !inClass )
164 {
165 stream.writeText( "@var " );
166 stream.writeText( type->getTypeClassName() );
167 stream.writeText( " " );
168 stream.writeText( entry->name );

Callers 1

dumpVariablesFunction · 0.85

Calls 14

dStrstrFunction · 0.85
dStricmpFunction · 0.85
lookupNamespaceFunction · 0.85
getTypeFunction · 0.85
dumpDocFunction · 0.85
splitMethod · 0.80
StringClass · 0.70
errorfFunction · 0.70
sizeMethod · 0.45
c_strMethod · 0.45
firstMethod · 0.45
writeTextMethod · 0.45

Tested by

no test coverage detected