![]() |
|
PhoenixGenerator
3.4.0
Generate code from template files and projects in C++, Rust, Python and wrapped C++ to Python
|
#include "openFileStream.h"#include "header_generator.h"#include "rust_type_utils.h"#include "generator_class_rust.h"Go to the source code of this file.
Functions | |
| bool | generator_rust_class (const PRustTraitBackendManager &manager, const std::vector< PClassConfig > &vecClassConfig, const PPath &outputSourceDir, const PPath &baseFileName, const GeneratorMode &mode) |
| Write the Rust module (one file per pdata file) containing every struct/enum it defines. | |
| bool | generator_rust_class_file (const PRustTraitBackendManager &manager, std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) |
| Write the Rust struct, Default implementation and getter/setter methods matching the given PClassConfig. | |
| bool | generator_rust_class_full (const PRustTraitBackendManager &manager, const ProjectParam &projectParam) |
| Generate the full Rust sources (and related integration tests) from configuration. | |
| bool | generator_rust_class_test (const PRustTraitBackendManager &manager, const PPath &outputTestDir, const PString &crateName, const PPath &baseFileName, const std::vector< PClassConfig > &vecClassConfig, const GeneratorMode &mode) |
| Write the Rust integration test file (one file per pdata file) exercising every non-enum class it defines. | |
| bool | generator_rust_enum_file (std::ofstream &fs, const PClassConfig &classConfig) |
| Write the Rust enum matching the given PClassConfig. | |
| bool | rust_checkDefaultValueExist (const std::vector< PClassAttribute > &vecAttr) |
| Check if the vector of PClassAttribute has default value. | |
| bool generator_rust_class | ( | const PRustTraitBackendManager & | manager, |
| const std::vector< PClassConfig > & | vecClassConfig, | ||
| const PPath & | outputSourceDir, | ||
| const PPath & | baseFileName, | ||
| const GeneratorMode & | mode ) |
Write the Rust module (one file per pdata file) containing every struct/enum it defines.
| manager | : PRustTraitBackendManager which handles all trait backend |
| rsFile | : file to be saved |
| vecClassConfig | : configuration of the classes to be used |
| mode | : mode of the generator |
Definition at line 108 of file generator_class_rust.cpp.
References generator_rust_class(), generator_rust_class_file(), generator_rust_enum_file(), PRustTraitBackendManager::headerExtraInclude(), and licenceSave().
Referenced by generator_rust_class(), and generator_rust_class_full().
| bool generator_rust_class_file | ( | const PRustTraitBackendManager & | manager, |
| std::ofstream & | fs, | ||
| const PClassConfig & | classConfig, | ||
| const GeneratorMode & | mode ) |
Write the Rust struct, Default implementation and getter/setter methods matching the given PClassConfig.
| manager | : PRustTraitBackendManager which handles all trait backend | |
| [out] | fs | : file to be completed |
| classConfig | : PClassConfig to be used | |
| mode | : mode of the generator |
Definition at line 69 of file generator_class_rust.cpp.
References PRustTraitBackendManager::classExtraDeclaration(), generator_rust_class_file(), PClassConfig::getClassDocumentation(), PClassConfig::getListAttribute(), PClassConfig::getName(), getRustAttributeDefaultValue(), getRustType(), and PRustTraitBackendManager::implMethodDeclaration().
Referenced by generator_rust_class(), and generator_rust_class_file().
| bool generator_rust_class_full | ( | const PRustTraitBackendManager & | manager, |
| const ProjectParam & | projectParam ) |
Generate the full Rust sources (and related integration tests) from configuration.
| manager | : PRustTraitBackendManager which handles all trait backend |
| projectParam | : description of classes and how and where to generate sources and test |
Definition at line 163 of file generator_class_rust.cpp.
References GeneratorMode::enableUnitTest, generator_rust_class(), generator_rust_class_full(), generator_rust_class_test(), PDataConfig::getFileName(), PDataConfig::getVecClassConfig(), ProjectParam::mode, GeneratorMode::moduleName, ProjectParam::outputSourceDir, ProjectParam::outputTestDir, and ProjectParam::vecDataConfig.
Referenced by generateRustClassesFull(), and generator_rust_class_full().
| bool generator_rust_class_test | ( | const PRustTraitBackendManager & | manager, |
| const PPath & | outputTestDir, | ||
| const PString & | crateName, | ||
| const PPath & | baseFileName, | ||
| const std::vector< PClassConfig > & | vecClassConfig, | ||
| const GeneratorMode & | mode ) |
Write the Rust integration test file (one file per pdata file) exercising every non-enum class it defines.
| manager | : PRustTraitBackendManager which handles all trait backend |
| outputTestDir | : directory where to save the test |
| crateName | : name of the Cargo crate the generated sources belong to |
| moduleName | : name of the Rust module (matches the generated source file base name) |
| vecClassConfig | : configuration of the classes to be used |
| mode | : mode of the generator |
Definition at line 137 of file generator_class_rust.cpp.
References generator_rust_class_test(), licenceSave(), and PRustTraitBackendManager::testFunction().
Referenced by generator_rust_class_full(), and generator_rust_class_test().
| bool generator_rust_enum_file | ( | std::ofstream & | fs, |
| const PClassConfig & | classConfig ) |
Write the Rust enum matching the given PClassConfig.
| [out] | fs | : file to be completed |
| classConfig | : PClassConfig to be used |
Definition at line 29 of file generator_class_rust.cpp.
References generator_rust_enum_file(), PClassConfig::getClassDocumentation(), PClassConfig::getListAttribute(), PClassConfig::getName(), and rust_checkDefaultValueExist().
Referenced by generator_rust_class(), and generator_rust_enum_file().
| bool rust_checkDefaultValueExist | ( | const std::vector< PClassAttribute > & | vecAttr | ) |
Check if the vector of PClassAttribute has default value.
| vecAttr | : vector of attribute to be checked |
Definition at line 16 of file generator_class_rust.cpp.
References rust_checkDefaultValueExist().
Referenced by generator_rust_enum_file(), and rust_checkDefaultValueExist().