feat(cpp-object-oriented-modular-refactoring): step 6 - io-application-google-style

This commit is contained in:
KOKO\Mimi
2026-08-16 06:59:50 +09:00
parent bb178c9d3c
commit 83fd1d1c7e
31 changed files with 10499 additions and 11445 deletions
+24
View File
@@ -0,0 +1,24 @@
#ifndef FESA_IO_ABAQUS_DOMAIN_MAPPER_H_
#define FESA_IO_ABAQUS_DOMAIN_MAPPER_H_
#include "fesa/core/status.h"
#include "fesa/io/abaqus/input_syntax.h"
#include "fesa/model/domain.h"
namespace fesa {
/// @brief Maps syntax-only blocks into an approved immutable semantic model.
/// @note Source identity and declaration order are preserved through mapping.
class AbaqusDomainMapper {
public:
/// @brief Resolves supported Abaqus syntax into a complete Domain candidate.
/// @param input Parsed syntax whose source locations remain valid for
/// mapping.
/// @return A committed Domain or structured input/model diagnostics; partial
/// domains are never returned.
Result<Domain> Map(const ParsedInput& input) const;
};
} // namespace fesa
#endif // FESA_IO_ABAQUS_DOMAIN_MAPPER_H_
-15
View File
@@ -1,15 +0,0 @@
#pragma once
#include "fesa/core/status.h"
#include "fesa/io/abaqus/input_syntax.hpp"
#include "fesa/model/domain.h"
namespace fesa {
// Converts syntax-only blocks into the approved immutable B33 semantic model.
class AbaqusDomainMapper {
public:
Result<Domain> map(const ParsedInput& input) const;
};
} // namespace fesa
+24
View File
@@ -0,0 +1,24 @@
#ifndef FESA_IO_ABAQUS_INPUT_READER_H_
#define FESA_IO_ABAQUS_INPUT_READER_H_
#include <filesystem>
#include "fesa/core/status.h"
#include "fesa/io/abaqus/input_syntax.h"
namespace fesa {
/// @brief Reads Abaqus physical keyword, data, and comment syntax.
/// @note Semantic policy is applied later by AbaqusDomainMapper.
class AbaqusInputReader {
public:
/// @brief Parses one input file without applying semantic mapping policy.
/// @param input_path Path to the exact source bytes whose identity is
/// retained.
/// @return Parsed syntax or a structured input diagnostic.
Result<ParsedInput> Read(const std::filesystem::path& input_path) const;
};
} // namespace fesa
#endif // FESA_IO_ABAQUS_INPUT_READER_H_
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include "fesa/core/status.h"
#include "fesa/io/abaqus/input_syntax.hpp"
#include <filesystem>
namespace fesa {
// Reads only physical keyword/data/comment syntax; semantic policy is applied
// later by AbaqusDomainMapper.
class AbaqusInputReader {
public:
Result<ParsedInput> read(const std::filesystem::path& inputPath) const;
};
} // namespace fesa
+46
View File
@@ -0,0 +1,46 @@
#ifndef FESA_IO_ABAQUS_INPUT_SYNTAX_H_
#define FESA_IO_ABAQUS_INPUT_SYNTAX_H_
#include <filesystem>
#include <optional>
#include <string>
#include <vector>
#include "fesa/core/source_identity.h"
namespace fesa {
/// @brief Stores a canonical parameter name and its optional source value.
/// @note Parameter names are canonicalized for lookup while values remain
/// source text.
struct KeywordParameter {
std::string name;
std::optional<std::string> value;
};
/// @brief Stores one parsed data row with its source location.
struct DataLine {
std::vector<std::string> fields;
SourceLocation location;
};
/// @brief Stores one syntax-only keyword block and its following data rows.
struct KeywordBlock {
std::string canonical_name;
std::string original_line;
std::vector<KeywordParameter> parameters;
std::vector<DataLine> data;
SourceLocation location;
};
/// @brief Stores the parsed syntax and stable identity of one Abaqus input
/// file.
struct ParsedInput {
std::filesystem::path source_path;
std::string source_content_identity;
std::vector<KeywordBlock> blocks;
};
} // namespace fesa
#endif // FESA_IO_ABAQUS_INPUT_SYNTAX_H_
-37
View File
@@ -1,37 +0,0 @@
#pragma once
#include "fesa/core/source_identity.h"
#include <filesystem>
#include <optional>
#include <string>
#include <vector>
namespace fesa {
// Names are canonicalized for syntax lookup while values remain source text.
struct KeywordParameter {
std::string name;
std::optional<std::string> value;
};
struct DataLine {
std::vector<std::string> fields;
SourceLocation location;
};
struct KeywordBlock {
std::string canonicalName;
std::string originalLine;
std::vector<KeywordParameter> parameters;
std::vector<DataLine> data;
SourceLocation location;
};
struct ParsedInput {
std::filesystem::path sourcePath;
std::string sourceContentIdentity;
std::vector<KeywordBlock> blocks;
};
} // namespace fesa