Command Line INterpreter with fixes
This commit is contained in:
parent
62cb2bb8b7
commit
576a3565f7
14 changed files with 384 additions and 95 deletions
|
|
@ -12,6 +12,10 @@ add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS})
|
|||
target_include_directories(${PROJECT_NAME} PUBLIC ./public/)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Strings)
|
||||
|
||||
|
||||
### -------------------------- Applications -------------------------- ###
|
||||
add_subdirectory(applications)
|
||||
|
||||
### -------------------------- Tests -------------------------- ###
|
||||
enable_testing()
|
||||
file(GLOB TEST_SOURCES "./tests/*.cpp")
|
||||
|
|
@ -19,8 +23,4 @@ add_executable(${PROJECT_NAME}Tests ${TEST_SOURCES})
|
|||
target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} Utils)
|
||||
add_test(NAME ${PROJECT_NAME}Tests COMMAND ${PROJECT_NAME}Tests)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib)
|
||||
|
||||
|
||||
# todo :remove
|
||||
add_subdirectory(applications)
|
||||
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib)
|
||||
|
|
@ -3,9 +3,15 @@ cmake_minimum_required(VERSION 3.2)
|
|||
|
||||
project(Applications)
|
||||
|
||||
### ---------------------- Applications --------------------- ###
|
||||
add_executable(Server ./Server.cpp)
|
||||
add_executable(Client ./Client.cpp)
|
||||
file(GLOB SOURCES_CLIENT ./Client.cpp)
|
||||
file(GLOB SOURCES_SERVER ./Server.cpp)
|
||||
|
||||
include_directories(Client ./../../Externals/asio/asio/include)
|
||||
include_directories(Server ./../../Externals/asio/asio/include)
|
||||
set(ASIO_INCLUDE ./../../Externals/asio/asio/include)
|
||||
|
||||
add_executable(Client ${SOURCES_CLIENT})
|
||||
include_directories(Client ${ASIO_INCLUDE})
|
||||
#link_libraries(Client Storage CommandLine)
|
||||
|
||||
add_executable(Server ${SOURCES_SERVER})
|
||||
include_directories(Server ${ASIO_INCLUDE})
|
||||
#link_libraries(Server Storage CommandLine)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,21 @@
|
|||
|
||||
#include "SystemHandle.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
using namespace tp;
|
||||
|
||||
|
||||
bool FileLocation::exists() const {
|
||||
FILE* file = fopen(mLocation.read(), "r");
|
||||
if (file) {
|
||||
// File exists, close it and return 1
|
||||
fclose(file);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool File::connect(const FileLocation& location, const FileConnectionType& connectionInfo) {
|
||||
DEBUG_ASSERT(!mStatus.isOpened());
|
||||
if (mStatus.isOpened()) return false;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ namespace tp {
|
|||
explicit FileLocation(const String& location) : mLocation(location) {}
|
||||
void setLocation(const String& location) { mLocation = location; }
|
||||
[[nodiscard]] const String& getLocation() const { return mLocation; }
|
||||
[[nodiscard]] bool exists() const;
|
||||
};
|
||||
|
||||
class FileConnectionType {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue