Privacy
An open-source, flexible 3D physical simulation framework
misc.cpp File Reference
#include "misc.h"
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <vector>
#include <sstream>
#include <iostream>
#include <cassert>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <stdio.h>

Go to the source code of this file.

Namespaces

 mars
 Copyright 2012, DFKI GmbH Robotics Innovation Center.
 
 mars::utils
 

Functions

bool mars::utils::matchPattern (const std::string &pattern, const std::string &str)
 basic pattern matching function More...
 
std::string mars::utils::trim (const std::string &str)
 remove leading and trailing whitespaces More...
 
void mars::utils::handleFilenamePrefix (std::string *file, const std::string &prefix)
 
std::string mars::utils::pathJoin (const std::string &path1, const std::string &path2)
 
void mars::utils::removeFilenamePrefix (std::string *file)
 given a filepath "bla/da/fnord/foobar.baz" this will remove everything before and including the last slash "/" resulting in "foobar.baz". More...
 
void mars::utils::removeFilenameSuffix (std::string *file)
 given a filename "foobar.baz" this will remove the extension (including the dot ".") resulting in "foobar". More...
 
std::string mars::utils::getFilenameSuffix (const std::string &file)
 given a filename "foobar.baz" this will return ".baz" More...
 
std::string mars::utils::getCurrentWorkingDir ()
 
std::string mars::utils::getPathOfFile (const std::string &filename)
 
unsigned int mars::utils::createDirectory (const std::string &dir, int mode=0755)
 creates a directory at the given path. More...
 
std::vector< std::string > mars::utils::explodeString (const char c, const std::string &s)
 
std::string mars::utils::replaceString (const std::string &source, const std::string &s1, const std::string &s2)
 
std::string mars::utils::toupper (const std::string &s)
 
std::string mars::utils::tolower (const std::string &s)