Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
myconfig.h
00001 #ifndef MYCONFIG_H 00002 #define MYCONFIG_H 00003 #include "ConfigFile.h" 00004 #include <string.h> 00005 00006 class myConfig: public ConfigFile { 00007 public: 00008 static const int MAXLEN_VALUE = 128;//redeclared because inaccessible 00009 int getInt(char *key, int dflt=0) { 00010 char value[MAXLEN_VALUE]; 00011 if (getValue(key, value, sizeof(value))) { 00012 int val=dflt; 00013 sscanf(value,"%d", &val); 00014 return val; 00015 } 00016 return dflt; 00017 } 00018 int getLookup(char *key, char*names[], int n) { 00019 char value[MAXLEN_VALUE]; 00020 if (getValue(key, value, sizeof(value))) { 00021 for (int i = 0; i < n; i++) 00022 if (strcmp(value, names[i])==0) 00023 return i; 00024 } 00025 return n; 00026 } 00027 }; 00028 00029 #endif
Generated on Tue Jul 12 2022 20:02:50 by
1.7.2