Range of leading comments (before any group)
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);
Leading comments.