Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Poprawki w utils

  • Loading branch information...
commit 2aa09dbca7bd36d8229aa58149674dc9f3ed35c2 1 parent 163fbdd
@frondeus authored
View
2  utils/config.h
@@ -1,5 +1,5 @@
#pragma once
-
+#include <string>
#include <map>
#include "string.h"
View
2  utils/lang.h
@@ -2,7 +2,7 @@
#include <string>
#include <map>
-
+#include "string.h"
class Lang
{
public:
View
4 utils/logger.cpp
@@ -1,7 +1,7 @@
#include <time.h>
#include "logger.h"
-Logger log;
+Logger logg;
void Logger::update()
{
@@ -26,7 +26,7 @@ std::ostringstream& Logger::get(int line, const char* func, const char* file)
if(debug)
oss << "[" << file << "]" << "(" << func << "," << line << ") ";
oss << "[" << godzina << "] ";
- if(onLogger) onLog();
+ if(onLog) onLog();
return oss;
}
View
4 utils/system.h
@@ -0,0 +1,4 @@
+#pragma once
+#include <vector>
+#include <string>
+int seekDir(std::vector<std::string>& list, std::string path, std::string ext);
View
25 utils/unix.cpp
@@ -0,0 +1,25 @@
+#include <sys/types.h>
+#include <dirent.h>
+#include <vector>
+#include <string>
+#include <iostream>
+
+int seekDir(std::vector<std::string>& list, std::string path,std::string ext)
+{
+ DIR* dir = opendir(path.c_str());
+ if(!dir) return 0;
+
+ dirent *d;
+ while((d = readdir(dir)))
+ {
+ if(d->d_type == DT_REG)
+ {
+ std::string name = d->d_name;
+ unsigned f = name.find_first_of(".");
+ if(name.substr(f+1) == ext)
+ list.push_back(name.substr(0,f));
+ }
+ }
+ closedir(dir);
+ return 1;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.