From cb60240f3f846ba8d70fb25220c18bb883eefff6 Mon Sep 17 00:00:00 2001 From: Anselme Date: Sun, 24 Apr 2016 15:28:28 +0200 Subject: [PATCH] tiny fix --- resource/main.cpp | 4 ++-- test/CMakeLists.txt | 2 +- test/resDir/test.txt | 2 ++ test/test.cpp | 2 ++ test/test.txt | 2 -- 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 test/resDir/test.txt delete mode 100644 test/test.txt diff --git a/resource/main.cpp b/resource/main.cpp index db81823..02bb5bf 100644 --- a/resource/main.cpp +++ b/resource/main.cpp @@ -58,9 +58,9 @@ int main(int argc, char *argv[]) string outFilename(argv[1]); string packName = outFilename.substr(outFilename.find_last_of('/')+1); packName = packName.substr(0, packName.find_first_of('.')); - if(!regex_match(packName, regex("[a-zA-Z0-9]+"))) + if(!regex_match(packName, regex("[a-zA-Z0-9]+"))) { - printf("error : \"%s\" is an invalid resource pack name, it must match this regex : [a-zA-Z0-9]+\n", packName.c_str()); + printf("error : \"%s\" is an invalid resource pack name, it must match this regex : [a-zA-Z0-9]+\n", packName.c_str()); return EXIT_SUCCESS; } FILE *out = fopen(outFilename.c_str(), "w"); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9f7b968..7af8046 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_TEMPLATE_PATH "..") #SET(RESOURCE_DIRS /shaders) #SET(RES_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/plop.txt ${CMAKE_CURRENT_SOURCE_DIR}/plop2.txt) -FILE(GLOB RES_SRC_FILE hello.txt test.txt) +FILE(GLOB RES_SRC_FILE hello.txt resDir/test.txt) SET(RESOURCE_DST_FILE res.cpp) # choose source file diff --git a/test/resDir/test.txt b/test/resDir/test.txt new file mode 100644 index 0000000..22be9c0 --- /dev/null +++ b/test/resDir/test.txt @@ -0,0 +1,2 @@ +This is a test +fefea diff --git a/test/test.cpp b/test/test.cpp index 4369063..86a4a11 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -10,6 +10,8 @@ int main() Resource::ResourceMap resMap; Resource::getResourcePack_res(resMap); + cout << resMap["hello.txt"] << endl; + cout << "resources available : " << endl << endl; for(auto it : resMap) cout << it.first << " -> " << it.second << endl; diff --git a/test/test.txt b/test/test.txt deleted file mode 100644 index 4a927de..0000000 --- a/test/test.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a tessst -fefea