mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6181 from shujunqiao/console-std
modify const char* to std::string in CCConsole.
This commit is contained in:
commit
5fae622209
|
@ -414,13 +414,13 @@ void Console::commandHelp(int fd, const std::string &args)
|
|||
for(auto it=_commands.begin();it!=_commands.end();++it)
|
||||
{
|
||||
auto cmd = it->second;
|
||||
mydprintf(fd, "\t%s", cmd.name);
|
||||
ssize_t tabs = strlen(cmd.name) / 8;
|
||||
mydprintf(fd, "\t%s", cmd.name.c_str());
|
||||
ssize_t tabs = strlen(cmd.name.c_str()) / 8;
|
||||
tabs = 3 - tabs;
|
||||
for(int j=0;j<tabs;j++){
|
||||
mydprintf(fd, "\t");
|
||||
}
|
||||
mydprintf(fd,"%s\n", cmd.help);
|
||||
mydprintf(fd,"%s\n", cmd.help.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,8 +74,8 @@ class CC_DLL Console
|
|||
{
|
||||
public:
|
||||
struct Command {
|
||||
const char* name;
|
||||
const char* help;
|
||||
std::string name;
|
||||
std::string help;
|
||||
std::function<void(int, const std::string&)> callback;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue