enum_name
Loading...
Searching...
No Matches
Functions | Variables
amalgamate Namespace Reference

Functions

Optional[str] find_file (str include_path, List[str] source_dirs, Optional[str] current_dir=None)
 
Tuple[List[str], Optional[str]] read_file_content (str filepath)
 
List[str] inline_file (str filepath, List[str] source_dirs, Set[str] seen_guards, Set[str] processed_files)
 
 main ()
 

Variables

 RE_INCLUDE_LOCAL = re.compile(r'#\s*include\s+"([^"]+)"')
 
 RE_INCLUDE_SYSTEM = re.compile(r'#\s*include\s+<([^>]+)>')
 
 RE_IFNDEF = re.compile(r'#\s*ifndef\s+(\w+)')
 
 RE_DEFINE = re.compile(r'#\s*define\s+(\w+)')
 
 RE_PRAGMA_ONCE = re.compile(r'#\s*pragma\s+once')
 

Detailed Description

Script to amalgamate the enum_name library into a single header file.

Usage:
    python3 scripts/amalgamate.py \
        --main include/mgutility/reflection/enum_name.hpp \
        --source-dir include \
        --source-dir mgutility/include \
        --output single_include/mgutility_enum_name.hpp

Function Documentation

◆ find_file()

Optional[str] amalgamate.find_file ( str include_path,
List[str] source_dirs,
Optional[str] current_dir = None )
Try to find an included file.

First tries relative to the including file's directory (current_dir),
then tries in each source directory.

◆ inline_file()

List[str] amalgamate.inline_file ( str filepath,
List[str] source_dirs,
Set[str] seen_guards,
Set[str] processed_files )
Inline the content of a project header file, resolving its local includes.
Returns a list of strings (lines).

◆ read_file_content()

Tuple[List[str], Optional[str]] amalgamate.read_file_content ( str filepath)
Read a file and return (lines, guard_macro_or_none).
Also detects #pragma once and returns it as a pseudo-guard.