MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / BasicCmdcmdlist

Method BasicCmdcmdlist

physx/samples/samplebase/SampleConsole.cpp:71–99  ·  view source on GitHub ↗

CMDLIST: a basic command to display a list of all possible commands Usage: cmdlist <= display all possible commands cmdlist [command] <= check whether a command exists or not

Source from the content-addressed store, hash-verified

69// Usage: cmdlist <= display all possible commands
70// cmdlist [command] <= check whether a command exists or not
71void Console::BasicCmdcmdlist(Console* console, const char* text, void* user_data)
72{
73 ConsoleCommand* pcmd;
74 if(!text)
75 {
76 for(int i=0;i<256;i++)
77 {
78 pcmd = console->mCmds[i];
79 while(pcmd)
80 {
81 console->out(pcmd->fullcmd);
82 pcmd = pcmd->next;
83 }
84 }
85 }
86 else
87 {
88 int i = text[0];
89 if( (i >= 'A') && (i<='Z') )
90 i -= 'A' - 'a';
91 pcmd = console->mCmds[i];
92 while(pcmd)
93 {
94 if(Ps::strncmp(pcmd->fullcmd, text, strlen(text)) == 0)
95 console->out(pcmd->fullcmd);
96 pcmd = pcmd->next;
97 }
98 }
99}
100
101// CMDHIST: a basic command to display command history
102// Usage: cmdhist

Callers

nothing calls this directly

Calls 2

strncmpFunction · 0.85
outMethod · 0.80

Tested by

no test coverage detected