Moved some around, more renames

This commit is contained in:
KimLS
2014-08-21 22:43:33 -07:00
parent 504a8b19ce
commit cd0824ee71
63 changed files with 8 additions and 10 deletions
@@ -0,0 +1,23 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(pfslist_sources
Source/main.cpp
)
SET(pfslist_headers
)
INCLUDE_DIRECTORIES(Include
../Common/Include
)
ADD_EXECUTABLE(PFSList ${pfslist_sources} ${pfslist_headers})
TARGET_LINK_LIBRARIES(PFSList Common ${ZLIB_LIBRARY} "Ws2_32.lib")
IF(MSVC)
ADD_DEFINITIONS(/D _CONSOLE)
SET_TARGET_PROPERTIES(PFSList PROPERTIES LINK_FLAGS_RELEASE "/OPT:REF /OPT:ICF")
ENDIF(MSVC)
SET(EXECUTABLE_OUTPUT_PATH ../Build/PFSList)
@@ -0,0 +1,35 @@
#include <stdio.h>
#include <string>
#include "PFSArchive.h"
int main(int argc, char **argv) {
if(argc < 3) {
printf("Usage: %s ext file1 [file2...]\n", argv[0]);
return 1;
}
for(int i = 2; i < argc; ++i) {
PFSArchive archive;
if(!archive.Open(argv[i])) {
printf("Error: couldn't open %s\n", argv[i]);
continue;
}
std::list<std::string> files;
if(!archive.GetFiles(argv[1], files)) {
printf("Error: couldn't return the files with ext: %s\n", argv[1]);
continue;
}
printf("Files in %s:\n", argv[i]);
std::list<std::string>::const_iterator iter = files.begin();
while(iter != files.end()) {
printf("%s\n", (*iter).c_str());
iter++;
}
printf("\n");
archive.Close();
}
return 0;
}