#pragma once #include #include #include #include #include #include namespace sh { enum class Command { exit, echo, type, pwd, cd, unknown }; inline const std::mapcommandMap { {"exit", Command::exit}, {"echo", Command::echo}, {"type", Command::type}, {"pwd" , Command::pwd }, {"cd" , Command::cd } }; inline constexpr std::string_view doubleQuoteEscapeChars = "\"$`\n\\"; inline constexpr std::string_view tokenDelimiters = " \t"; void tokenize(std::vector& tokens, const std::string& input); Command getCommand(std::string_view input); std::optional isExec(const std::string& input); void printType(const std::string& input); std::filesystem::path getWorkingDir(); void changeDir(const std::vector& tokens); }