Type for describing a source file
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int64), | public | :: | digest |
Current hash |
|||
character(len=:), | public, | allocatable | :: | exe_name |
Name of executable for FPM_UNIT_PROGRAM |
||
character(len=:), | public, | allocatable | :: | file_name |
File path relative to cwd |
||
type(string_t), | public, | allocatable | :: | include_dependencies(:) |
Files INCLUDEd by this source file |
||
type(string_t), | public, | allocatable | :: | link_libraries(:) |
Native libraries to link against |
||
type(string_t), | public, | allocatable | :: | modules_provided(:) |
Modules provided by this source file (lowerstring) |
||
type(string_t), | public, | allocatable | :: | modules_used(:) |
Modules USEd by this source file (lowerstring) |
||
type(string_t), | public, | allocatable | :: | parent_modules(:) |
Parent modules (submodules only) |
||
integer, | public | :: | unit_scope | = | FPM_SCOPE_UNKNOWN |
Target module-use scope |
|
integer, | public | :: | unit_type | = | FPM_UNIT_UNKNOWN |
Type of source unit |
Dump dependency to toml table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Write serializable object to file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Write serializable object to a formatted Fortran unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
Formatted unit |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format requested? |
Dump dependency to toml table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency from toml table (no checks made at this stage)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency tree from file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency tree from file init JSON interpreter Read object from TOML table
use default TOML parser
Read object from TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency from toml table (no checks made at this stage)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Check that two source files are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Serialization interface
Check that two source files are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Test load/write roundtrip
Test serialization of a serializable object Dump to scratch file Load from scratch file Check same
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | message | |||
type(error_t), | intent(out), | allocatable | :: | error |
type, extends(serializable_t) :: srcfile_t !> File path relative to cwd character(:), allocatable :: file_name !> Name of executable for FPM_UNIT_PROGRAM character(:), allocatable :: exe_name !> Target module-use scope integer :: unit_scope = FPM_SCOPE_UNKNOWN !> Modules provided by this source file (lowerstring) type(string_t), allocatable :: modules_provided(:) !> Type of source unit integer :: unit_type = FPM_UNIT_UNKNOWN !> Parent modules (submodules only) type(string_t), allocatable :: parent_modules(:) !> Modules USEd by this source file (lowerstring) type(string_t), allocatable :: modules_used(:) !> Files INCLUDEd by this source file type(string_t), allocatable :: include_dependencies(:) !> Native libraries to link against type(string_t), allocatable :: link_libraries(:) !> Current hash integer(int64) :: digest contains !> Serialization interface procedure :: serializable_is_same => srcfile_is_same procedure :: dump_to_toml => srcfile_dump_to_toml procedure :: load_from_toml => srcfile_load_from_toml end type srcfile_t