{"id":18336780,"url":"https://github.com/seissol/fty","last_synced_at":"2025-04-09T19:56:25.946Z","repository":{"id":117608054,"uuid":"287994738","full_name":"SeisSol/fty","owner":"SeisSol","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-27T10:59:55.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T19:56:23.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SeisSol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-16T17:46:03.000Z","updated_at":"2024-09-27T10:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ec2a70a-8595-4932-a76b-ea4b42cbae3e","html_url":"https://github.com/SeisSol/fty","commit_stats":null,"previous_names":["seissol/fty"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeisSol%2Ffty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeisSol%2Ffty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeisSol%2Ffty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeisSol%2Ffty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeisSol","download_url":"https://codeload.github.com/SeisSol/fty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103910,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T20:08:55.321Z","updated_at":"2025-04-09T19:56:25.927Z","avatar_url":"https://github.com/SeisSol.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n  SPDX-FileCopyrightText: 2020-2023 Ravil Dorozhinskii\n\n  SPDX-License-Identifier: MIT\n--\u003e\n\n# fty - Fortran To Yaml\n\nIt is a small header-only C++ library which is supposed to help people to start converting their legacy Fortran code to C++. The library reads a text file or lists of strings formatted according  to Fortran *NAMELIST I/O* style, and generates a YAML::Node (a hash table) containing retrieved information.\n\n## Requirements\nMake sure that you have **yaml-cpp** installed\n\n## Exceptions\nThe library throws the following exceptions in case of a failure during a convertion:\n```\nfty::exception::FileException\nfty::exception::CriticalTextBlockException\nfty::exception::CriticalKeyValueError\n```\n## Policies\nThe library offers several base policies for storing keys in a generated hash table due to issues related to the case sensitivity.\n\n| Name         \t| Description                                      \t|\n|--------------\t|--------------------------------------------------\t|\n| AsOriginal   \t| stores keys as it is given in an input file/list \t|\n| AsUppercase \t| converts all keys to upper-case                  \t|\n| AsLowercase \t| converts all keys to lower-case                  \t|\n\nIf none of the policies fit to your particular problem you can provide yours by defining and providing a class to either *fty::Loader* or *fty::Converter*\n\n#### Policy Example\n```\nstruct MyPolicy {\n  std::string apply(const std::string\u0026 String) {\n    std::string ConvertedString(String.size(), '\\0');\n    // your code is here\n    return ConvertedString;\n  }\n};\n\nfty::Loader\u003cMyPolicy\u003e Loader{};\n```\n\n\n## Code Example\n```\n#include \"Fty.hpp\"\n#include \u003ciostream\u003e\n#include \u003ccstdlib\u003e\n\nint main(int Argc, char *Argv[]) {\n  if (Argc != 2) {\n    std::cerr \u003c\u003c \"Error: Please, provide an input file\\n\";\n    std::cerr \u003c\u003c \"Example: fty-converter [input file path]\\n\";\n    exit(EXIT_FAILURE);\n  }\n\n  std::string FileName = Argv[1];\n  fty::Loader\u003cfty::AsLowercase\u003e Loader{};\n  try {\n    YAML::Node Params = Loader.load(FileName);\n    std::cout \u003c\u003c Params;\n  }\n  catch (const fty::exception::FileException\u0026 Error) {\n    std::cerr \u003c\u003c Error.what() \u003c\u003c std::endl;\n  }\n  catch (const std::exception\u0026 Error) {\n    std::cerr \u003c\u003c Error.what() \u003c\u003c std::endl;\n    throw Error;\n  }\n  return 0;\n}\n```\nSee **CMakeLists.txt** as an example of compiling\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseissol%2Ffty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseissol%2Ffty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseissol%2Ffty/lists"}