mirror of
				https://github.com/Ed94/gencpp.git
				synced 2025-10-30 22:40:54 -07:00 
			
		
		
		
	Reduce cpp freatures usage of Array container.
Almost ready to be inter-operable with C
This commit is contained in:
		| @@ -18,6 +18,32 @@ GEN_NS_END | ||||
|  | ||||
| using namespace gen; | ||||
|  | ||||
| constexpr char const* generation_notice = | ||||
| "// This file was generated automatially by gencpp's c_library.cpp" | ||||
| "(See: https://github.com/Ed94/gencpp)\n\n"; | ||||
|  | ||||
| constexpr StrC roll_own_dependencies_guard_start = txt(R"( | ||||
| //! If its desired to roll your own dependencies, define GEN_ROLL_OWN_DEPENDENCIES before including this file. | ||||
| // Dependencies are derived from the c-zpl library: https://github.com/zpl-c/zpl | ||||
| #ifndef GEN_ROLL_OWN_DEPENDENCIES | ||||
| )"); | ||||
|  | ||||
| constexpr StrC roll_own_dependencies_guard_end = txt(R"( | ||||
| // GEN_ROLL_OWN_DEPENDENCIES | ||||
| #endif | ||||
| )"); | ||||
|  | ||||
| constexpr StrC implementation_guard_start = txt(R"( | ||||
| #pragma region GENCPP IMPLEMENTATION GUARD | ||||
| #if defined(GEN_IMPLEMENTATION) && ! defined(GEN_IMPLEMENTED) | ||||
| #	define GEN_IMPLEMENTED | ||||
| )"); | ||||
|  | ||||
| constexpr StrC implementation_guard_end = txt(R"( | ||||
| #endif | ||||
| #pragma endregion GENCPP IMPLEMENTATION GUARD | ||||
| )"); | ||||
|  | ||||
| void format_file( char const* path ) | ||||
| { | ||||
| 	String resolved_path = String::make(GlobalAllocator, to_str(path)); | ||||
| @@ -59,6 +85,20 @@ int gen_main() | ||||
| #define project_dir "../project/" | ||||
| 	gen::init(); | ||||
|  | ||||
| 	Code push_ignores        = scan_file( project_dir "helpers/push_ignores.inline.hpp" ); | ||||
| 	Code pop_ignores         = scan_file( project_dir "helpers/pop_ignores.inline.hpp" ); | ||||
| 	Code single_header_start = scan_file( "components/header_start.hpp" ); | ||||
|  | ||||
| 	Builder | ||||
| 	header = Builder::open( "gen/gen.hpp" ); | ||||
| 	header.print_fmt( generation_notice ); | ||||
| 	header.print_fmt("#pragma once\n\n"); | ||||
| 	header.print( push_ignores ); | ||||
|  | ||||
| 	// Headers | ||||
| 	{ | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	gen::deinit(); | ||||
| 	return 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user