#include <ndb_global.h>#include "Parser.hpp"#include <NdbOut.hpp>#include <Properties.hpp>Include dependency graph for Parser.cpp:

Go to the source code of this file.
Classes | |
| class | ParseInputStream |
Defines | |
| #define | DEBUG(x) ndbout << x << endl; |
Functions | |
| static void | trim (char *str) |
| static bool | Empty (const char *str) |
| static bool | Eof (const char *str) |
| static bool | split (char *buf, char **name, char **value) |
Definition at line 25 of file Parser.cpp.
| static bool Empty | ( | const char * | str | ) | [static] |
Definition at line 81 of file Parser.cpp.
References strlen().
Referenced by ParserImpl::run().
00081 { 00082 if(str == 0) 00083 return true; 00084 const int len = strlen(str); 00085 if(len == 0) 00086 return false; 00087 for(int i = 0; i<len; i++) 00088 if(str[i] != ' ' && str[i] != '\t' && str[i] != '\n') 00089 return false; 00090 return true; 00091 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static bool Eof | ( | const char * | str | ) | [static] |
Definition at line 95 of file Parser.cpp.
Referenced by ParserImpl::run().
Here is the caller graph for this function:

| static bool split | ( | char * | buf, | |
| char ** | name, | |||
| char ** | value | |||
| ) | [static] |
Definition at line 121 of file Parser.cpp.
References strchr(), and trim().
00121 { 00122 00123 * value = strchr(buf, ':'); 00124 if(* value == 0) 00125 * value = strchr(buf, '='); 00126 00127 00128 if(* value == 0){ 00129 return false; 00130 } 00131 (* value)[0] = 0; 00132 * value = (* value + 1); 00133 * name = buf; 00134 00135 trim(* name); 00136 trim(* value); 00137 00138 return true; 00139 }
Here is the call graph for this function:

| static void trim | ( | char * | str | ) | [static] |
Definition at line 99 of file Parser.cpp.
References memmove, NULL, pos(), and strlen().
Referenced by InitConfigFileParser::convertStringToUint64(), CPCD::Process::do_exec(), insert(), insert_row(), ndb_mgm_get_status(), InitConfigFileParser::parseConfig(), InitConfigFileParser::parseNameValuePair(), InitConfigFileParser::parseSectionHeader(), ParserImpl::run(), set_ulimit(), and split().
00099 { 00100 if(str == NULL) 00101 return; 00102 int len = strlen(str); 00103 for(len--; str[len] == '\n' || str[len] == ' ' || str[len] == '\t'; len--) 00104 str[len] = 0; 00105 00106 int pos = 0; 00107 while(str[pos] == ' ' || str[pos] == '\t') 00108 pos++; 00109 00110 if(str[pos] == '\"' && str[len] == '\"') { 00111 pos++; 00112 str[len] = 0; 00113 len--; 00114 } 00115 00116 memmove(str, &str[pos], len - pos + 2); 00117 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

