If only one argument is given, generate sources to a temporary directory,
build them (as bundle), and install them to the current directory.
Otherwise, the old behaviour applies.
+ Don't indent the __cplusplus ifdef block in generated headers.
* README:
Update with details of the new bundle feature and single-argument operation.
* Makefile:
H.WriteLine ();
H.WriteLine ("#ifdef __cplusplus");
- H.WriteLine ("extern \"C\" {");
+ H.WriteLine ("extern \"C\" {", false);
H.WriteLine ("#endif /* __cplusplus */");
H.WriteLine ();
H.WriteLine ();
H.WriteLine ("#ifdef __cplusplus");
- H.WriteLine ("}");
+ H.WriteLine ("}", false);
H.WriteLine ("#endif /* __cplusplus */");
H.WriteLine ();
}
public void WriteLine (string text)
+ {
+ WriteLine (text, true);
+ }
+
+ public void WriteLine (string text, bool autoindent)
{
char[] opentags = {'{', '('};
char[] closetags = {'}', ')'};
- if (text.TrimStart (closetags) != text)
+ if (autoindent && text.TrimStart (closetags) != text)
Outdent ();
w.Write (cur_indent);
w.WriteLine (text);
- if (text.TrimEnd (opentags) != text)
+ if (autoindent && text.TrimEnd (opentags) != text)
Indent ();
}