diff --git a/SYNTAX.rst b/SYNTAX.rst index c9276e06..e415dbf1 100644 --- a/SYNTAX.rst +++ b/SYNTAX.rst @@ -239,7 +239,15 @@ Primitive fields can be classified as following: These tags correspond to ``char[bytes]``, ``char*``, and ``std::string``. -4) File Stream:: +5) Path:: + + + + This tag corresponds to ``std::filesystem::path`` and is used to + abstractly represent a path to a filesystem object in an + architecture-independent manner. + +6) File Stream:: diff --git a/StructFields.pm b/StructFields.pm index 2d73aa77..5baf63e7 100644 --- a/StructFields.pm +++ b/StructFields.pm @@ -115,6 +115,7 @@ my %custom_primitive_handlers = ( 'stl-mutex' => sub { header_ref("mutex"); return "std::mutex"; }, 'stl-condition-variable' => sub { header_ref("condition_variable"); return "std::condition_variable"; }, 'stl-future' => sub { header_ref("future"); return "std::future"; }, + 'stl-fs-path' => sub { header_ref("filesystem"); return "std::filesystem::path"; }, ); my %custom_primitive_inits = ( @@ -125,6 +126,13 @@ my %custom_primitive_inits = ( add_simple_init "\"$cur_init_value\""; } }, + 'stl-fs-path' => sub { + if (defined $cur_init_value) { + $cur_init_value =~ s/\\/\\\\/g; + $cur_init_value =~ s/\"/\\\"/g; + add_simple_init "\"$cur_init_value\""; + } + }, ); my %custom_container_handlers = ( diff --git a/data-definition.xsd b/data-definition.xsd index a327619d..18271caa 100644 --- a/data-definition.xsd +++ b/data-definition.xsd @@ -232,6 +232,7 @@ + @@ -379,6 +380,12 @@ + + + + + + diff --git a/lower-1.xslt b/lower-1.xslt index 2d16b745..0ff956bd 100644 --- a/lower-1.xslt +++ b/lower-1.xslt @@ -218,9 +218,10 @@ Error: field corresponds to an enum value of + - +