diff --git a/ceevlang b/ceevlang index 9745e4d..ccc88d0 160000 --- a/ceevlang +++ b/ceevlang @@ -1 +1 @@ -Subproject commit 9745e4d63a0579f859247e3395fb33af8eafe2eb +Subproject commit ccc88d088865952b488eb3282531a48e8e5aae4a diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..4897b4b --- /dev/null +++ b/src/README.md @@ -0,0 +1,239 @@ +# CeeV Documentation + +## Includes + +```cpp +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +``` + +## Statics + +```cpp +#define __ceev_version +``` +The current version of CeeV + +```cpp +#define CONFIG_FILENAME +``` +The filename used in `ceev init` + +```cpp +#define GIT_COMMIT_HASH +``` +The latest git commit hash, defined by cmake. + +```cpp +#define GIT_COMMIT_MSG +``` +The latest git commit message, defined by cmake. + +```cpp +#define GIT_COMMIT_DATE +``` +The latest git commit date, defined by cmake. + +```cpp +#define GIT_COMMIT_AUTHOR +``` +The author of the latest git commit, defined by cmake. + +```cpp +#define GET_PROGRAM_NAME() +``` +The program invocation name. + +```cpp +#define INPROG +``` +Shorthand for marking item as in progress in devel_roadmap() + +```cpp +#define TODO b +``` +Shorthand for marking item as todo in devel_roadmap() + +```cpp +#define HALTED +``` +Shorthand for marking item as halted in devel_roadmap() + +```cpp +#define STATUS +``` +Shorthand for the status in devel_roadmap() + +## Structures + +```cpp +struct config_data { + std::string name = ""; + std::string version = ""; + std::string author = ""; + std::string email = ""; +}; +``` +The struct for the configuration + +## Functions + +```cpp +static int usage(); +``` +Returns: int exit_code - Always 1 + +Shows the usage of the program. + +```cpp +static int show_help(); +``` +Returns: int exit_code - Always 0 + +Shows the help for the program when the user runs `ceev -h`. + +```cpp +static int buildinfo(); +``` +Returns: int exit_code - Always 0 + +Shows the build information when the user runs `ceev -B`. + +```cpp +bool replace(std::string& str, const std::string& from, const std::string& to); +``` +Param: std::string& str - The input string to be modifyed + +Param: const std::string& from - What to replace + +Param: const std::string& to - What to replace with + +Returns: bool success - Whether it was successful or not. + +Replaces `from` with `to` within the string. + +```cpp +static std::string query_author(); +``` +Returns: The string input in the function + +Queries the user for a string to be used as the project author. + +```cpp +struct config_data get_config(bool ignore_err = false) +``` +Param: int ignore_err - Normally false + +Returns: struct config_data + +Reads the config file and builds the config_data struct. Returns an empty struct +if it cannot open the file. ignore_err suppresses the error message, used for +`ceev devel sdl2 --use-defaults`. + +```cpp +int create_fs(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +Creates the default file system. + +```cpp +int build_project(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +Not yet implemented. + + +```cpp +int run_project(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +Not properly implemented yet, but prints out the config data and runs the SDL2 +demo. + +```cpp +int clean_project(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +Not yet implemented + +```cpp +int devel(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +The subcommand `ceev devel`. Parses the inputs and runs supplementary functions. + + +```cpp +int devel_help(); +``` +Returns: int exit_code + +Shows the help page for `ceev devel`. + +```cpp +int devel_roadmap(); +``` +Returns: int exit_code + +Shows the current roadmap. + +```cpp +int devel_sdl2(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +Runs a small demo with SDL2. Running with the `--use-defaults` flag doesn't +require you to use a config file. + +```cpp +int devel_lang(std::deque args); +``` +Param: std::deque\ args - The arguments from main(), with used +values stripped out. + +Returns: int exit_code + +Not yet implemented + +```cpp +int main(int argc, char **argv); +``` +Param: int argc - The number of arguments + +Param: char \*\*argv - An array of the arguments + +Returns: int exit_code + +The entrypoint. Parses the arguments and puts them into a deque. It then runs +the other functions based on what has been input in the arguments. diff --git a/src/ceev.cc b/src/ceev.cc index bdb4e9c..8ce3681 100644 --- a/src/ceev.cc +++ b/src/ceev.cc @@ -184,6 +184,7 @@ int create_fs(std::deque args) { } int build_project(std::deque args) { + std::cout << TODO << ": Function is not made yet.\n"; std::cout << "Building project..." << std::endl; return 0; } @@ -199,6 +200,7 @@ int run_project(std::deque args) { } int clean_project(std::deque args) { + std::cout << TODO << ": Function is not made yet.\n"; std::cout << "Cleaning project..." << std::endl; return 0; } @@ -327,7 +329,7 @@ int devel_sdl2(std::deque args) { } int devel_lang(std::deque args) { - std::cerr << "Not implemented yet" << std::endl; + std::cout << TODO << ": Function is not made yet.\n"; return 1; } diff --git a/src/ceev.h b/src/ceev.h index b091577..4bc3a7d 100644 --- a/src/ceev.h +++ b/src/ceev.h @@ -60,6 +60,7 @@ static int show_help(); static int buildinfo(); bool replace(std::string& str, const std::string& from, const std::string& to); static std::string query_author(); +struct config_data get_config(bool ignore_err); int create_fs(std::deque args); int build_project(std::deque args); int run_project(std::deque args);