fix `@embedFile` docs

master
Andrew Kelley 2020-03-06 16:01:26 -05:00
parent 3dc8cb12e8
commit 0e5b48d1a2
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 6 additions and 4 deletions

View File

@ -7281,11 +7281,13 @@ test "main" {
{#see_also|@divFloor|@divExact#}
{#header_close#}
{#header_open|@embedFile#}
<pre>{#syntax#}@embedFile(comptime path: []const u8) [X]u8{#endsyntax#}</pre>
<pre>{#syntax#}@embedFile(comptime path: []const u8) *const [X:0]u8{#endsyntax#}</pre>
<p>
This function returns a compile time constant fixed-size array with length
equal to the byte count of the file given by {#syntax#}path{#endsyntax#}. The contents of the array
are the contents of the file.
This function returns a compile time constant pointer to null-terminated,
fixed-size array with length equal to the byte count of the file given by
{#syntax#}path{#endsyntax#}. The contents of the array are the contents of the file.
This is equivalent to a {#link|string literal|String Literals and Character Literals#}
with the file contents.
</p>
<p>
{#syntax#}path{#endsyntax#} is absolute or relative to the current file, just like {#syntax#}@import{#endsyntax#}.