From 181a4049309600ef31c2d22b3823429c6ee331df Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sat, 18 Jan 2014 19:20:40 +0100 Subject: Fixed warnings about unknown commands in scene files --- src/script/cmdtoken.cpp | 10 ++++++++++ src/script/cmdtoken.h | 1 + 2 files changed, 11 insertions(+) (limited to 'src/script') diff --git a/src/script/cmdtoken.cpp b/src/script/cmdtoken.cpp index da4a886..6393505 100644 --- a/src/script/cmdtoken.cpp +++ b/src/script/cmdtoken.cpp @@ -35,6 +35,16 @@ char* SkipSpace(char *line) return line; } +std::string GetCmd(char* line) +{ + line = SkipSpace(line); + + int len = 0; + for(char* x = line; *x != 0 && *x != ' ' && *x != '\t' && *x != '\n'; x++, len++); + + return std::string(line, len); +} + // Checks if a line contains a command. bool Cmd(char *line, const char *token) diff --git a/src/script/cmdtoken.h b/src/script/cmdtoken.h index 24b592f..8a423c5 100644 --- a/src/script/cmdtoken.h +++ b/src/script/cmdtoken.h @@ -30,6 +30,7 @@ // Procedures. +extern std::string GetCmd(char* line); extern bool Cmd(char *line, const char *token); extern char* SearchOp(char *line, const char *op); -- cgit v1.2.3-1-g7c22