utils.cc File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <utils.h>
#include <Platform.h>

Go to the source code of this file.

Functions

const void * file_get_contents (const char *filename, size_t *size)
bool file_unmap_contents (void *base, size_t size)
bool getNonEmptyLine (fstream &file, string &line, bool onlyMySection, bool *mySection)


Function Documentation

const void* file_get_contents const char *  filename,
size_t *  size
 

loads a file to memory. size is filled with the file's size or -1 if the return value is NULL

Definition at line 33 of file utils.cc.

References fd.

bool file_unmap_contents void *  base,
size_t  size
 

frees the memory allocated with file_get_contents

Definition at line 57 of file utils.cc.

bool getNonEmptyLine fstream &  file,
string &  line,
bool  onlyMySection,
bool *  mySection
 

wrapper around STL's getline. this only returns non-empty line plus trimming and optional robot model checking

Definition at line 63 of file utils.cc.

References ROBOTDESIGN.


Generated on Sun Dec 2 23:04:32 2007 for openSDK by  doxygen 1.3.9.1