Function IniLikeFile.leadingComments
Leading comments.
auto final const(string[]) leadingComments() pure nothrow @nogc @safe const;
Returns
Range of leading comments (before any group)
See Also
appendLeadingComment
, prependLeadingComment
, clearLeadingComments
Example
auto ilf = new IniLikeFile();
assert(ilf .appendLeadingComment("First") == "#First");
assert(ilf .appendLeadingComment("#Second") == "#Second");
assert(ilf .appendLeadingComment("Sneaky\nKey=Value") == "#Sneaky Key=Value");
assert(ilf .appendLeadingComment("# New Line\n") == "# New Line");
assert(ilf .appendLeadingComment("") == "");
assert(ilf .appendLeadingComment("\n") == "");
assert(ilf .prependLeadingComment("Shebang") == "#Shebang");
assert(ilf .leadingComments() .equal(["#Shebang", "#First", "#Second", "#Sneaky Key=Value", "# New Line", "", ""]));
ilf .clearLeadingComments();
assert(ilf .leadingComments() .empty);