#include <Properties.hpp>
Collaboration diagram for Properties:

Public Member Functions | |
| Properties (bool case_insensitive=false) | |
| Properties (const Properties &) | |
| Properties (const Property *, int len) | |
| virtual | ~Properties () |
| void | setCaseInsensitiveNames (bool value) |
| bool | getCaseInsensitiveNames () const |
| void | put (const Property *, int len) |
| bool | put (const char *name, Uint32 value, bool replace=false) |
| bool | put64 (const char *name, Uint64 value, bool replace=false) |
| bool | put (const char *name, const char *value, bool replace=false) |
| bool | put (const char *name, const Properties *value, bool replace=false) |
| bool | put (const char *, Uint32 no, Uint32, bool replace=false) |
| bool | put64 (const char *, Uint32 no, Uint64, bool replace=false) |
| bool | put (const char *, Uint32 no, const char *, bool replace=false) |
| bool | put (const char *, Uint32 no, const Properties *, bool replace=false) |
| bool | getTypeOf (const char *name, PropertiesType *type) const |
| bool | contains (const char *name) const |
| bool | get (const char *name, Uint32 *value) const |
| bool | get (const char *name, Uint64 *value) const |
| bool | get (const char *name, const char **value) const |
| bool | get (const char *name, BaseString &value) const |
| bool | get (const char *name, const Properties **value) const |
| bool | getCopy (const char *name, char **value) const |
| bool | getCopy (const char *name, Properties **value) const |
| bool | getTypeOf (const char *name, Uint32 no, PropertiesType *type) const |
| bool | contains (const char *name, Uint32 no) const |
| bool | get (const char *name, Uint32 no, Uint32 *value) const |
| bool | get (const char *name, Uint32 no, Uint64 *value) const |
| bool | get (const char *name, Uint32 no, const char **value) const |
| bool | get (const char *name, Uint32 no, const Properties **value) const |
| bool | getCopy (const char *name, Uint32 no, char **value) const |
| bool | getCopy (const char *name, Uint32 no, Properties **value) const |
| void | clear () |
| void | remove (const char *name) |
| void | print (FILE *file=stdout, const char *prefix=0) const |
| Uint32 | getPackedSize () const |
| bool | pack (Uint32 *buf) const |
| bool | pack (UtilBuffer &buf) const |
| bool | unpack (const Uint32 *buf, Uint32 bufLen) |
| bool | unpack (UtilBuffer &buf) |
| Uint32 | getPropertiesErrno () const |
| Uint32 | getOSErrno () const |
Static Public Attributes | |
| static const char | delimiter = ':' |
| static const char | version [] = { 2, 0, 0, 1, 1, 1, 1, 4 } |
Private Member Functions | |
| void | setErrno (Uint32 pErr, Uint32 osErr=0) const |
Private Attributes | |
| Uint32 | propErrno |
| Uint32 | osErrno |
| PropertiesImpl * | impl |
| Properties * | parent |
Friends | |
| class | Properties::Iterator |
| class | PropertiesImpl |
Classes | |
| class | Iterator |
Definition at line 53 of file Properties.hpp.
| Properties::Properties | ( | bool | case_insensitive = false |
) |
Methods for Properties
Definition at line 118 of file Properties.cpp.
References impl, parent, and PropertiesImpl.
Referenced by getCopy().
00118 { 00119 parent = 0; 00120 impl = new PropertiesImpl(this, case_insensitive); 00121 }
Here is the caller graph for this function:

| Properties::Properties | ( | const Properties & | ) |
Definition at line 123 of file Properties.cpp.
References impl, parent, and PropertiesImpl.
00123 { 00124 parent = 0; 00125 impl = new PropertiesImpl(this, * org.impl); 00126 }
| Properties::Properties | ( | const Property * | , | |
| int | len | |||
| ) |
Definition at line 128 of file Properties.cpp.
References impl, PropertiesImpl, and put().
00128 { 00129 impl = new PropertiesImpl(this, false); 00130 00131 put(anArray, arrayLen); 00132 }
Here is the call graph for this function:

| Properties::~Properties | ( | ) | [virtual] |
| void Properties::clear | ( | ) |
Definition at line 341 of file Properties.cpp.
References PropertiesImpl::content, impl, PropertiesImpl::items, PropertyImpl::name, and PropertiesImpl::remove().
Referenced by ~Properties().
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1050 of file Properties.cpp.
References contains(), free, malloc, BaseString::snprintf(), and strlen().
01050 { 01051 size_t tmp_len = strlen(name)+20; 01052 char * tmp = (char*)malloc(tmp_len); 01053 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01054 bool res = contains(tmp); 01055 free(tmp); 01056 return res; 01057 }
Here is the call graph for this function:

| bool Properties::contains | ( | const char * | name | ) | const |
Definition at line 208 of file Properties.cpp.
References PropertiesImpl::get(), and impl.
Referenced by ParserImpl::checkMandatory(), contains(), and Config::printAllNameValuePairs().
00208 { 00209 PropertyImpl * nvp = impl->get(name); 00210 return nvp != 0; 00211 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Properties::get | ( | const char * | name, | |
| Uint32 | no, | |||
| const Properties ** | value | |||
| ) | const |
Definition at line 1092 of file Properties.cpp.
References free, get(), malloc, BaseString::snprintf(), strlen(), and value.
01092 { 01093 size_t tmp_len = strlen(name)+20; 01094 char * tmp = (char*)malloc(tmp_len); 01095 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01096 bool res = get(tmp, value); 01097 free(tmp); 01098 return res; 01099 }
Here is the call graph for this function:

Definition at line 1081 of file Properties.cpp.
References free, get(), malloc, BaseString::snprintf(), and strlen().
01081 { 01082 size_t tmp_len = strlen(name)+20; 01083 char * tmp = (char*)malloc(tmp_len); 01084 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01085 bool res = get(tmp, value); 01086 free(tmp); 01087 return res; 01088 }
Here is the call graph for this function:

Definition at line 1070 of file Properties.cpp.
References free, get(), malloc, BaseString::snprintf(), and strlen().
01070 { 01071 size_t tmp_len = strlen(name)+20; 01072 char * tmp = (char*)malloc(tmp_len); 01073 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01074 bool res = get(tmp, value); 01075 free(tmp); 01076 return res; 01077 }
Here is the call graph for this function:

Definition at line 1060 of file Properties.cpp.
References free, get(), malloc, BaseString::snprintf(), and strlen().
01060 { 01061 size_t tmp_len = strlen(name)+20; 01062 char * tmp = (char*)malloc(tmp_len); 01063 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01064 bool res = get(tmp, value); 01065 free(tmp); 01066 return res; 01067 }
Here is the call graph for this function:

| bool Properties::get | ( | const char * | name, | |
| const Properties ** | value | |||
| ) | const |
Definition at line 291 of file Properties.cpp.
References E_PROPERTIES_INVALID_TYPE, E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, PropertiesImpl::get(), impl, PropertiesType_Properties, setErrno(), PropertyImpl::value, value, and PropertyImpl::valueType.
00291 { 00292 PropertyImpl * nvp = impl->get(name); 00293 if(nvp == 0){ 00294 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00295 return false; 00296 } 00297 if(nvp->valueType == PropertiesType_Properties){ 00298 * value = (const Properties *)nvp->value; 00299 setErrno(E_PROPERTIES_OK); 00300 return true; 00301 } 00302 setErrno(E_PROPERTIES_INVALID_TYPE); 00303 return false; 00304 }
Here is the call graph for this function:

| bool Properties::get | ( | const char * | name, | |
| BaseString & | value | |||
| ) | const |
| bool Properties::get | ( | const char * | name, | |
| const char ** | value | |||
| ) | const |
Definition at line 265 of file Properties.cpp.
References E_PROPERTIES_INVALID_TYPE, E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, PropertiesImpl::get(), impl, PropertiesType_char, setErrno(), PropertyImpl::value, and PropertyImpl::valueType.
00265 { 00266 PropertyImpl * nvp = impl->get(name); 00267 if(nvp == 0){ 00268 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00269 return false; 00270 } 00271 00272 if(nvp->valueType == PropertiesType_char){ 00273 * value = (const char *)nvp->value; 00274 setErrno(E_PROPERTIES_OK); 00275 return true; 00276 } 00277 setErrno(E_PROPERTIES_INVALID_TYPE); 00278 return false; 00279 }
Here is the call graph for this function:

Definition at line 241 of file Properties.cpp.
References E_PROPERTIES_INVALID_TYPE, E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, PropertiesImpl::get(), impl, PropertiesType_Uint32, PropertiesType_Uint64, setErrno(), PropertyImpl::value, and PropertyImpl::valueType.
00241 { 00242 PropertyImpl * nvp = impl->get(name); 00243 if(nvp == 0){ 00244 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00245 return false; 00246 } 00247 00248 if(nvp->valueType == PropertiesType_Uint32){ 00249 Uint32 tmp = * (Uint32 *)nvp->value; 00250 * value = (Uint64)tmp; 00251 setErrno(E_PROPERTIES_OK); 00252 return true; 00253 } 00254 00255 if(nvp->valueType == PropertiesType_Uint64){ 00256 * value = * (Uint64 *)nvp->value; 00257 setErrno(E_PROPERTIES_OK); 00258 return true; 00259 } 00260 setErrno(E_PROPERTIES_INVALID_TYPE); 00261 return false; 00262 }
Here is the call graph for this function:

Definition at line 214 of file Properties.cpp.
References E_PROPERTIES_INVALID_TYPE, E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, PropertiesImpl::get(), impl, max, PropertiesType_Uint32, PropertiesType_Uint64, setErrno(), PropertyImpl::value, and PropertyImpl::valueType.
Referenced by add_a_connection(), add_node_connections(), backward(), check_node_vs_replicas(), checkConnectionConstraints(), ConfigInfo::ConfigInfo(), fixDepricated(), fixNodeHostname(), fixPortNumber(), get(), get_int_property(), ConfigInfo::getDefaults(), ConfigInfo::getInfo(), getInfoInt(), getInfoString(), IPCConfig::getNodeType(), IPCConfig::getREPHBFrequency(), InitConfigFileParser::getSection(), ClusterConfiguration::init(), IPCConfig::init(), ndb_mgm_abort_backup(), ndb_mgm_alloc_nodeid(), ndb_mgm_dump_state(), ndb_mgm_enter_single_user(), ndb_mgm_exit_single_user(), ndb_mgm_get_clusterlog_severity_filter(), ndb_mgm_get_configuration(), ndb_mgm_get_connection_int_parameter(), ndb_mgm_get_mgmd_nodeid(), ndb_mgm_get_version(), ndb_mgm_insert_error(), ndb_mgm_log_signals(), ndb_mgm_purge_stale_sessions(), ndb_mgm_rep_command(), ndb_mgm_restart3(), ndb_mgm_set_clusterlog_loglevel(), ndb_mgm_set_clusterlog_severity_filter(), ndb_mgm_set_connection_int_parameter(), ndb_mgm_set_int64_parameter(), ndb_mgm_set_int_parameter(), ndb_mgm_set_loglevel_node(), ndb_mgm_set_string_parameter(), ndb_mgm_set_trace(), ndb_mgm_start(), ndb_mgm_start_backup(), ndb_mgm_start_signallog(), ndb_mgm_stop3(), ndb_mgm_stop_signallog(), Config::printAllNameValuePairs(), Config::printConfigFile(), CPCD::Process::Process(), and propToString().
00214 { 00215 PropertyImpl * nvp = impl->get(name); 00216 if(nvp == 0){ 00217 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00218 return false; 00219 } 00220 00221 if(nvp->valueType == PropertiesType_Uint32){ 00222 * value = * (Uint32 *)nvp->value; 00223 setErrno(E_PROPERTIES_OK); 00224 return true; 00225 } 00226 00227 if(nvp->valueType == PropertiesType_Uint64){ 00228 Uint64 tmp = * (Uint64 *)nvp->value; 00229 Uint64 max = 1; max <<= 32; 00230 if(tmp < max){ 00231 * value = (Uint32)tmp; 00232 setErrno(E_PROPERTIES_OK); 00233 return true; 00234 } 00235 } 00236 setErrno(E_PROPERTIES_INVALID_TYPE); 00237 return false; 00238 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Properties::getCaseInsensitiveNames | ( | ) | const |
Definition at line 1129 of file Properties.cpp.
References impl, and PropertiesImpl::m_insensitive.
01129 { 01130 return impl->m_insensitive; 01131 }
| bool Properties::getCopy | ( | const char * | name, | |
| Uint32 | no, | |||
| Properties ** | value | |||
| ) | const |
Definition at line 1114 of file Properties.cpp.
References free, getCopy(), malloc, BaseString::snprintf(), strlen(), and value.
01114 { 01115 size_t tmp_len = strlen(name)+20; 01116 char * tmp = (char*)malloc(tmp_len); 01117 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01118 bool res = getCopy(tmp, value); 01119 free(tmp); 01120 return res; 01121 }
Here is the call graph for this function:

Definition at line 1103 of file Properties.cpp.
References free, getCopy(), malloc, BaseString::snprintf(), and strlen().
01103 { 01104 size_t tmp_len = strlen(name)+20; 01105 char * tmp = (char*)malloc(tmp_len); 01106 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01107 bool res = getCopy(tmp, value); 01108 free(tmp); 01109 return res; 01110 }
Here is the call graph for this function:

| bool Properties::getCopy | ( | const char * | name, | |
| Properties ** | value | |||
| ) | const |
Definition at line 324 of file Properties.cpp.
References E_PROPERTIES_INVALID_TYPE, E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, PropertiesImpl::get(), impl, Properties(), PropertiesType_Properties, setErrno(), PropertyImpl::value, value, and PropertyImpl::valueType.
00324 { 00325 PropertyImpl * nvp = impl->get(name); 00326 if(nvp == 0){ 00327 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00328 return false; 00329 } 00330 00331 if(nvp->valueType == PropertiesType_Properties){ 00332 * value = new Properties(* (const Properties *)nvp->value); 00333 setErrno(E_PROPERTIES_OK); 00334 return true; 00335 } 00336 setErrno(E_PROPERTIES_INVALID_TYPE); 00337 return false; 00338 }
Here is the call graph for this function:

| bool Properties::getCopy | ( | const char * | name, | |
| char ** | value | |||
| ) | const |
Definition at line 307 of file Properties.cpp.
References E_PROPERTIES_INVALID_TYPE, E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, f_strdup(), PropertiesImpl::get(), impl, PropertiesType_char, setErrno(), PropertyImpl::value, and PropertyImpl::valueType.
Referenced by ConfigInfo::ConfigInfo(), and getCopy().
00307 { 00308 PropertyImpl * nvp = impl->get(name); 00309 if(nvp == 0){ 00310 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00311 return false; 00312 } 00313 00314 if(nvp->valueType == PropertiesType_char){ 00315 * value = f_strdup((const char *)nvp->value); 00316 setErrno(E_PROPERTIES_OK); 00317 return true; 00318 } 00319 setErrno(E_PROPERTIES_INVALID_TYPE); 00320 return false; 00321 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Uint32 Properties::getOSErrno | ( | ) | const [inline] |
| Uint32 Properties::getPackedSize | ( | ) | const |
Definition at line 403 of file Properties.cpp.
References PropertiesImpl::getPackedSize(), impl, and version.
Referenced by MgmApiSession::getConfig_common(), and pack().
00403 { 00404 Uint32 sz = 0; 00405 00406 sz += sizeof(version); // Version id of properties object 00407 sz += 4; // No Of Items 00408 sz += 4; // Checksum 00409 00410 return sz + impl->getPackedSize(0); 00411 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Uint32 Properties::getPropertiesErrno | ( | ) | const [inline] |
| bool Properties::getTypeOf | ( | const char * | name, | |
| Uint32 | no, | |||
| PropertiesType * | type | |||
| ) | const |
Same as get above except that _d (where d = no) is added to the name
Definition at line 1039 of file Properties.cpp.
References free, getTypeOf(), malloc, BaseString::snprintf(), and strlen().
01040 { 01041 size_t tmp_len = strlen(name)+20; 01042 char * tmp = (char*)malloc(tmp_len); 01043 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01044 bool res = getTypeOf(tmp, type); 01045 free(tmp); 01046 return res; 01047 }
Here is the call graph for this function:

| bool Properties::getTypeOf | ( | const char * | name, | |
| PropertiesType * | type | |||
| ) | const |
Definition at line 196 of file Properties.cpp.
References E_PROPERTIES_NO_SUCH_ELEMENT, E_PROPERTIES_OK, PropertiesImpl::get(), impl, setErrno(), and PropertyImpl::valueType.
Referenced by backward(), fixDepricated(), getTypeOf(), and propToString().
00196 { 00197 PropertyImpl * nvp = impl->get(name); 00198 if(nvp == 0){ 00199 setErrno(E_PROPERTIES_NO_SUCH_ELEMENT); 00200 return false; 00201 } 00202 setErrno(E_PROPERTIES_OK); 00203 * type = nvp->valueType; 00204 return true; 00205 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Properties::pack | ( | UtilBuffer & | buf | ) | const [inline] |
Definition at line 237 of file Properties.hpp.
References buf, getPackedSize(), and pack().
00237 { 00238 Uint32 size = getPackedSize(); 00239 void *tmp_buf = buf.append(size); 00240 if(tmp_buf == 0) 00241 return false; 00242 bool ret = pack((Uint32 *)tmp_buf); 00243 if(ret == false) 00244 return false; 00245 return true; 00246 }
Here is the call graph for this function:

Definition at line 424 of file Properties.cpp.
References computeChecksum(), PropertiesImpl::getTotalItems(), impl, memcpy, PropertiesImpl::pack(), and version.
Referenced by MgmApiSession::getConfig_common(), and pack().
00424 { 00425 Uint32 * bufStart = buf; 00426 00427 memcpy(buf, version, sizeof(version)); 00428 00429 // Note that version must be a multiple of 4 00430 buf += (sizeof(version) / 4); 00431 00432 * buf = htonl(impl->getTotalItems()); 00433 buf++; 00434 bool res = impl->pack(buf, "", 0); 00435 if(!res) 00436 return res; 00437 00438 * buf = htonl(computeChecksum(bufStart, (buf - bufStart))); 00439 00440 return true; 00441 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Properties::print | ( | FILE * | file = stdout, |
|
| const char * | prefix = 0 | |||
| ) | const |
Definition at line 352 of file Properties.cpp.
References buf, PropertiesImpl::content, delimiter, impl, PropertiesImpl::items, PropertyImpl::name, PropertiesType_char, PropertiesType_Properties, PropertiesType_Uint32, PropertiesType_Uint64, BaseString::snprintf(), PropertyImpl::value, and PropertyImpl::valueType.
Referenced by define(), getInfoInt(), list(), main(), IPCConfig::print(), start(), stop(), and undefine().
00352 { 00353 char buf[1024]; 00354 if(prefix == 0) 00355 buf[0] = 0; 00356 else 00357 strncpy(buf, prefix, 1024); 00358 00359 for(unsigned int i = 0; i<impl->items; i++){ 00360 switch(impl->content[i]->valueType){ 00361 case PropertiesType_Uint32: 00362 fprintf(out, "%s%s = (Uint32) %d\n", buf, impl->content[i]->name, 00363 *(Uint32 *)impl->content[i]->value); 00364 break; 00365 case PropertiesType_Uint64: 00366 fprintf(out, "%s%s = (Uint64) %lld\n", buf, impl->content[i]->name, 00367 *(Uint64 *)impl->content[i]->value); 00368 break; 00369 case PropertiesType_char: 00370 fprintf(out, "%s%s = (char*) \"%s\"\n", buf, impl->content[i]->name, 00371 (char *)impl->content[i]->value); 00372 break; 00373 case PropertiesType_Properties: 00374 char buf2 [1024]; 00375 BaseString::snprintf(buf2, sizeof(buf2), "%s%s%c",buf, impl->content[i]->name, 00376 Properties::delimiter); 00377 ((Properties *)impl->content[i]->value)->print(out, buf2); 00378 break; 00379 } 00380 } 00381 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Properties::put | ( | const char * | , | |
| Uint32 | no, | |||
| const Properties * | , | |||
| bool | replace = false | |||
| ) |
Definition at line 1027 of file Properties.cpp.
References free, malloc, put(), BaseString::snprintf(), and strlen().
01028 { 01029 size_t tmp_len = strlen(name)+20; 01030 char * tmp = (char*)malloc(tmp_len); 01031 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01032 bool res = put(tmp, val, replace); 01033 free(tmp); 01034 return res; 01035 }
Here is the call graph for this function:

Definition at line 1016 of file Properties.cpp.
References free, malloc, put(), BaseString::snprintf(), and strlen().
01016 { 01017 size_t tmp_len = strlen(name)+20; 01018 char * tmp = (char*)malloc(tmp_len); 01019 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01020 bool res = put(tmp, val, replace); 01021 free(tmp); 01022 return res; 01023 }
Here is the call graph for this function:

Same as put above, except that _d (where d is a number) is added to the name Compare get(name, no)
Definition at line 995 of file Properties.cpp.
References free, malloc, put(), BaseString::snprintf(), and strlen().
00995 { 00996 size_t tmp_len = strlen(name)+20; 00997 char * tmp = (char*)malloc(tmp_len); 00998 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 00999 bool res = put(tmp, val, replace); 01000 free(tmp); 01001 return res; 01002 }
Here is the call graph for this function:

| bool Properties::put | ( | const char * | name, | |
| const Properties * | value, | |||
| bool | replace = false | |||
| ) |
Definition at line 191 of file Properties.cpp.
References impl, put(), and value.
00191 { 00192 return ::put(impl, name, value, replace); 00193 }
Here is the call graph for this function:

Definition at line 186 of file Properties.cpp.
00186 { 00187 return ::put(impl, name, value, replace); 00188 }
Here is the call graph for this function:

Definition at line 176 of file Properties.cpp.
00176 { 00177 return ::put(impl, name, value, replace); 00178 }
Here is the call graph for this function:

| void Properties::put | ( | const Property * | , | |
| int | len | |||
| ) |
Insert an array of value(s)
Definition at line 140 of file Properties.cpp.
References Property::impl, impl, and PropertiesImpl::put().
Referenced by add_a_connection(), add_node_connections(), backward(), check_node_vs_replicas(), ConfigInfo::ConfigInfo(), MgmApiSession::getConfig_common(), main(), Properties(), put(), put64(), putALot(), transform(), and PropertiesImpl::unpack().
00140 { 00141 if(anArray == 0) 00142 return; 00143 for(int i = 0; i<arrayLen; i++) 00144 impl->put(anArray[i].impl); 00145 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1005 of file Properties.cpp.
References free, malloc, put(), BaseString::snprintf(), and strlen().
01005 { 01006 size_t tmp_len = strlen(name)+20; 01007 char * tmp = (char*)malloc(tmp_len); 01008 BaseString::snprintf(tmp, tmp_len, "%s_%d", name, no); 01009 bool res = put(tmp, val, replace); 01010 free(tmp); 01011 return res; 01012 }
Here is the call graph for this function:

Definition at line 181 of file Properties.cpp.
Referenced by ConfigInfo::ConfigInfo(), main(), transform(), and PropertiesImpl::unpack().
00181 { 00182 return ::put(impl, name, value, replace); 00183 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Properties::remove | ( | const char * | name | ) |
Definition at line 347 of file Properties.cpp.
References impl, and PropertiesImpl::remove().
Referenced by check_node_vs_replicas().
Here is the call graph for this function:

Here is the caller graph for this function:

| void Properties::setCaseInsensitiveNames | ( | bool | value | ) |
Set/Get wheather names in the Properties should be compared w/o case. NOTE: The property is automatically applied to all propoerties put into this after a called to setCaseInsensitiveNames has been made But properties already in when calling setCaseInsensitiveNames will not be affected
Definition at line 1124 of file Properties.cpp.
References impl, and PropertiesImpl::setCaseInsensitiveNames().
01124 { 01125 impl->setCaseInsensitiveNames(value); 01126 }
Here is the call graph for this function:

These are methods that used to be inline
But Diab 4.1f could not compile -release with to many inlines
propErrno & osErrno used to be mutable, but diab didn't know what mutable meant.
Definition at line 976 of file Properties.cpp.
References osErrno, parent, propErrno, and setErrno().
Referenced by get(), getCopy(), getTypeOf(), PropertiesImpl::pack(), setErrno(), PropertiesImpl::setErrno(), PropertiesImpl::unpack(), and unpack().
00976 { 00977 if(parent != 0){ 00978 parent->setErrno(pErr, osErr); 00979 return ; 00980 } 00981 00986 *((Uint32*)&propErrno) = pErr; 00987 *((Uint32*)&osErrno) = osErr; 00988 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Properties::unpack | ( | UtilBuffer & | buf | ) | [inline] |
Definition at line 444 of file Properties.cpp.
References computeChecksum(), E_PROPERTIES_INVALID_BUFFER_TO_SHORT, E_PROPERTIES_INVALID_CHECKSUM, E_PROPERTIES_INVALID_VERSION_WHILE_UNPACKING, impl, memcmp(), setErrno(), PropertiesImpl::unpack(), and version.
Referenced by unpack().
00444 { 00445 const Uint32 * bufStart = buf; 00446 Uint32 bufLenOrg = bufLen; 00447 00448 if(bufLen < sizeof(version)){ 00449 setErrno(E_PROPERTIES_INVALID_BUFFER_TO_SHORT); 00450 return false; 00451 } 00452 00453 if(memcmp(buf, version, sizeof(version)) != 0){ 00454 setErrno(E_PROPERTIES_INVALID_VERSION_WHILE_UNPACKING); 00455 return false; 00456 } 00457 bufLen -= sizeof(version); 00458 00459 // Note that version must be a multiple of 4 00460 buf += (sizeof(version) / 4); 00461 00462 if(bufLen < 4){ 00463 setErrno(E_PROPERTIES_INVALID_BUFFER_TO_SHORT); 00464 return false; 00465 } 00466 00467 Uint32 totalItems = ntohl(* buf); 00468 buf++; bufLen -= 4; 00469 bool res = impl->unpack(buf, bufLen, this, totalItems); 00470 if(!res) 00471 return res; 00472 00473 Uint32 sum = computeChecksum(bufStart, (bufLenOrg-bufLen)/4); 00474 if(sum != ntohl(bufStart[(bufLenOrg-bufLen)/4])){ 00475 setErrno(E_PROPERTIES_INVALID_CHECKSUM); 00476 return false; 00477 } 00478 return true; 00479 }
Here is the call graph for this function:

Here is the caller graph for this function:

friend class Properties::Iterator [friend] |
Definition at line 142 of file Properties.hpp.
friend class PropertiesImpl [friend] |
const char Properties::delimiter = ':' [static] |
Definition at line 55 of file Properties.hpp.
Referenced by PropertiesImpl::getProps(), PropertiesImpl::getPropsPut(), PropertiesImpl::pack(), and print().
class PropertiesImpl* Properties::impl [private] |
Definition at line 157 of file Properties.hpp.
Referenced by clear(), contains(), get(), getCaseInsensitiveNames(), getCopy(), getPackedSize(), getTypeOf(), Properties::Iterator::next(), pack(), print(), Properties(), put(), put64(), remove(), setCaseInsensitiveNames(), unpack(), and ~Properties().
Uint32 Properties::osErrno [private] |
class Properties* Properties::parent [private] |
Uint32 Properties::propErrno [private] |
const char Properties::version = { 2, 0, 0, 1, 1, 1, 1, 4 } [static] |
Note has to be a multiple of 4 bytes
Definition at line 56 of file Properties.hpp.
Referenced by getPackedSize(), pack(), and unpack().
1.4.7

