Init cpp impl

This commit is contained in:
Stephen Seo 2021-05-10 14:16:10 +09:00
parent ba1cc1f294
commit 8672efe385
5 changed files with 47 additions and 0 deletions

3
cpp_impl/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
GreedyTextJustification
src/*.o
compile_commands.json

21
cpp_impl/Makefile Normal file
View file

@ -0,0 +1,21 @@
COMMON_FLAGS = -Wall -Wextra -Wpedantic
ifdef DEBUG
CXXFLAGS = $(COMMON_FLAGS) -O0 -g
else
CXXFLAGS = $(COMMON_FLAGS) -O3 -DNDEBUG
endif
OBJECTS = \
src/main.o \
src/argparse.o
all: GreedyTextJustification
GreedyTextJustification: $(OBJECTS)
$(CXX) $(CXXFLAGS) -o GreedyTextJustification $^
.PHONY:
clean:
rm -f GreedyTextJustification
rm -f src/*.o

View file

@ -0,0 +1,7 @@
#include "argparse.hpp"
std::unordered_map<std::string, std::string> ArgParse::parseArgs(int argc, char **argv) {
std::unordered_map<std::string, std::string> mapping;
return mapping;
}

11
cpp_impl/src/argparse.hpp Normal file
View file

@ -0,0 +1,11 @@
#ifndef GREEDY_TEXT_JUSTIFICATION_ARG_PARSE_HPP
#define GREEDY_TEXT_JUSTIFICATION_ARG_PARSE_HPP
#include <string>
#include <unordered_map>
namespace ArgParse {
std::unordered_map<std::string, std::string> parseArgs(int argc, char **argv);
} // namespace ArgParse
#endif

5
cpp_impl/src/main.cpp Normal file
View file

@ -0,0 +1,5 @@
int main(int argc, char **argv) {
return 0;
}