mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Moved some around, more renames
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user