From a5b62d8f09d24163e3f079bebe5c94ca5af44486 Mon Sep 17 00:00:00 2001 From: markuspg Date: Thu, 24 Jun 2021 21:24:16 +0200 Subject: [PATCH] Reorder buildincmd.h * reorder classes alphabetically * order class definitions according to the following order: * types * constructors * methods * members --- uuu/buildincmd.cpp | 2 +- uuu/buildincmd.h | 61 +++++++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/uuu/buildincmd.cpp b/uuu/buildincmd.cpp index 75f6e13..e5ec070 100644 --- a/uuu/buildincmd.cpp +++ b/uuu/buildincmd.cpp @@ -1,5 +1,5 @@ /* -* Copyright 2018 NXP. +* Copyright 2018-2021 NXP. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: diff --git a/uuu/buildincmd.h b/uuu/buildincmd.h index 78159fe..ae60e45 100644 --- a/uuu/buildincmd.h +++ b/uuu/buildincmd.h @@ -1,5 +1,5 @@ /* -* Copyright 2018 NXP. +* Copyright 2018-2021 NXP. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -28,60 +28,65 @@ * POSSIBILITY OF SUCH DAMAGE. * */ + #pragma once +#include +#include #include #include -#include -#include - -extern const char * g_vt_yellow ; -extern const char * g_vt_default ; -extern const char * g_vt_green ; -extern const char * g_vt_red ; -extern const char * g_vt_kcyn ; -extern const char * g_vt_boldwhite ; -struct BuildCmd -{ - const char *m_cmd; - const char *m_buildcmd; - const char *m_desc; -}; +extern const char * g_vt_boldwhite; +extern const char * g_vt_default; +extern const char * g_vt_kcyn; +extern const char * g_vt_green; +extern const char * g_vt_red ; +extern const char * g_vt_yellow; class Arg { public: - std::string m_arg; - std::string m_desc; - uint32_t m_flags; - std::string m_options; enum { ARG_MUST = 0x1, ARG_OPTION = 0x2, ARG_OPTION_KEY = 0x4, }; + Arg() { m_flags = ARG_MUST; } + int parser(std::string option); + + std::string m_arg; + std::string m_desc; + uint32_t m_flags; + std::string m_options; +}; + +struct BuildCmd +{ + const char *m_cmd; + const char *m_buildcmd; + const char *m_desc; }; class BuildInScript { public: - std::string m_script; - std::string m_desc; - std::string m_cmd; - std::vector m_args; - bool find_args(std::string arg); BuildInScript() {}; BuildInScript(BuildCmd*p); + bool find_args(std::string arg); + std::string replace_script_args(std::vector args); + std::string replace_str(std::string str, std::string key, std::string replace); void show(); void show_cmd(); std::string str_to_upper(std::string str); - std::string replace_str(std::string str, std::string key, std::string replace); - std::string replace_script_args(std::vector args); + + std::string m_script; + std::string m_desc; + std::string m_cmd; + std::vector m_args; }; class BuildInScriptVector : public std::map @@ -89,9 +94,9 @@ class BuildInScriptVector : public std::map public: BuildInScriptVector(BuildCmd*p); + void PrintAutoComplete(std::string match, const char *space=" " ); void ShowAll(); void ShowCmds(FILE * file=stdout); - void PrintAutoComplete(std::string match, const char *space=" " ); }; extern BuildInScriptVector g_BuildScripts; -- 2.11.4.GIT