Exemplo n.º 1
0
	bool CreateDirectory(const std::string& path, bool absolutePath){

		std::vector<std::string> dirList;
		split(path, '/', dirList);

		std::string npath;
		if( absolutePath ){
			npath = std::string("/");
		}else{
			npath = std::string("./");
		}

		for(std::vector<std::string>::iterator it = dirList.begin(); it != dirList.end(); ++it){
			Dir dir(npath.c_str());

			if( *it == std::string(".")  ){ continue; }
			if( *it == std::string("..") ){ npath += *it + std::string("/"); continue; }

			if( !dir.CreateDir(it->c_str()) ){
				LogW("cannnot create directory : %s\n", (npath + *it).c_str());
				return false;
			}

			npath += *it + std::string("/");
		}

		return true;
	}
Exemplo n.º 2
0
int Log::LogFmtW(const char * fmt_str, ...) 
{
  va_list args;
  va_start(args, fmt_str);
  int r = LogW(vastring_format(fmt_str,args));
  va_end(args);
  return r;
}