33 #include <h4r_ev3_control/FixedBuffer.h>
34 #include <h4r_ev3_control/StringEnum.h>
49 bool pathExists(
const char* path);
58 bool writeIntToSysFile(FILE *fileptr,
int value);
66 bool readIntFromSysFile(FILE *fileptr,
int &value);
76 bool writeKeyToSysFile(FILE *fileptr,
const StringEnum<T> &strmap, T key)
80 int len=strlen(strmap[key]);
81 strncpy(outbuf, strmap[key], len);
83 int wrote=fwrite(outbuf,1,len,fileptr);
100 bool readKeyFromSysFile(FILE *fileptr,
const StringEnum<T> &strmap, T &value)
107 char *buf=&buffer[0];
115 while ((read = getline(bufptr, &len, fileptr)) != -1) {
119 value=strmap[buffer];
142 fscanf(fileptr,
"%[^\n]",buffer);
155 bool matchFileContentInEqualSubdirectories(
const char* parent,
158 FileNameBuffer &match_dir);