Skip to content

Commit d4150ad

Browse files
committed
init make command
1 parent 6f77473 commit d4150ad

27 files changed

+1407
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
*
3+
* @file MakeCommand.hpp
4+
* @author Gaspard Kirira
5+
*
6+
* Copyright 2025, Gaspard Kirira. All rights reserved.
7+
* https://github.com/vixcpp/vix
8+
* Use of this source code is governed by a MIT license
9+
* that can be found in the License file.
10+
*
11+
* Vix.cpp
12+
*
13+
*/
14+
#ifndef VIX_MAKE_COMMAND_HPP
15+
#define VIX_MAKE_COMMAND_HPP
16+
17+
#include <string>
18+
#include <vector>
19+
20+
namespace vix::commands
21+
{
22+
struct MakeCommand
23+
{
24+
static int run(const std::vector<std::string> &args);
25+
static int help();
26+
};
27+
}
28+
29+
#endif

include/vix/cli/commands/make/ MakePaths.hpp

Whitespace-only changes.

include/vix/cli/commands/make/MakeDispatcher.hpp

Whitespace-only changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
*
3+
* @file MakeOptions.hpp
4+
* @author Gaspard Kirira
5+
*
6+
* Copyright 2025, Gaspard Kirira. All rights reserved.
7+
* https://github.com/vixcpp/vix
8+
* Use of this source code is governed by a MIT license
9+
* that can be found in the License file.
10+
*
11+
* Vix.cpp
12+
*
13+
*/
14+
#ifndef VIX_MAKE_OPTIONS_HPP
15+
#define VIX_MAKE_OPTIONS_HPP
16+
17+
#include <string>
18+
19+
namespace vix::cli::make
20+
{
21+
struct MakeOptions
22+
{
23+
std::string kind;
24+
std::string name;
25+
std::string dir;
26+
std::string in;
27+
std::string name_space;
28+
29+
bool force = false;
30+
bool dry_run = false;
31+
bool print_only = false;
32+
bool header_only = false;
33+
bool show_help = false;
34+
};
35+
}
36+
37+
#endif
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
*
3+
* @file MakeResult.hpp
4+
* @author Gaspard Kirira
5+
*
6+
* Copyright 2025, Gaspard Kirira. All rights reserved.
7+
* https://github.com/vixcpp/vix
8+
* Use of this source code is governed by a MIT license
9+
* that can be found in the License file.
10+
*
11+
* Vix.cpp
12+
*
13+
*/
14+
#ifndef VIX_MAKE_RESULT_HPP
15+
#define VIX_MAKE_RESULT_HPP
16+
17+
#include <filesystem>
18+
#include <string>
19+
#include <vector>
20+
21+
namespace vix::cli::make
22+
{
23+
struct MakeFile
24+
{
25+
std::filesystem::path path;
26+
std::string content;
27+
};
28+
29+
struct MakeResult
30+
{
31+
bool ok = false;
32+
std::vector<MakeFile> files;
33+
std::vector<std::string> notes;
34+
std::string preview;
35+
std::string error;
36+
};
37+
}
38+
39+
#endif
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
*
3+
* @file MakeTypes.hpp
4+
* @author Gaspard Kirira
5+
*
6+
* Copyright 2025, Gaspard Kirira. All rights reserved.
7+
* https://github.com/vixcpp/vix
8+
* Use of this source code is governed by a MIT license
9+
* that can be found in the License file.
10+
*
11+
* Vix.cpp
12+
*
13+
*/
14+
#ifndef VIX_MAKE_TYPES_HPP
15+
#define VIX_MAKE_TYPES_HPP
16+
17+
#include <string_view>
18+
19+
namespace vix::cli::make
20+
{
21+
enum class MakeKind
22+
{
23+
Unknown = 0,
24+
Class,
25+
Struct,
26+
Enum,
27+
Function,
28+
Lambda,
29+
Concept,
30+
Exception,
31+
Test,
32+
Module
33+
};
34+
35+
[[nodiscard]] constexpr std::string_view to_string(const MakeKind kind) noexcept
36+
{
37+
switch (kind)
38+
{
39+
case MakeKind::Class:
40+
return "class";
41+
case MakeKind::Struct:
42+
return "struct";
43+
case MakeKind::Enum:
44+
return "enum";
45+
case MakeKind::Function:
46+
return "function";
47+
case MakeKind::Lambda:
48+
return "lambda";
49+
case MakeKind::Concept:
50+
return "concept";
51+
case MakeKind::Exception:
52+
return "exception";
53+
case MakeKind::Test:
54+
return "test";
55+
case MakeKind::Module:
56+
return "module";
57+
case MakeKind::Unknown:
58+
default:
59+
return "unknown";
60+
}
61+
}
62+
}
63+
64+
#endif

include/vix/cli/commands/make/MakeUtils.hpp

Whitespace-only changes.

include/vix/cli/commands/make/generators/ClassGenerator.hpp

Whitespace-only changes.

include/vix/cli/commands/make/generators/ConceptGenerator.hpp

Whitespace-only changes.

include/vix/cli/commands/make/generators/EnumGenerator.hpp

Whitespace-only changes.

0 commit comments

Comments
 (0)