summaryrefslogtreecommitdiff
path: root/fluid/io/Project_Writer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/io/Project_Writer.cxx')
-rw-r--r--fluid/io/Project_Writer.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/fluid/io/Project_Writer.cxx b/fluid/io/Project_Writer.cxx
index 9af369c93..e2f670f8f 100644
--- a/fluid/io/Project_Writer.cxx
+++ b/fluid/io/Project_Writer.cxx
@@ -32,9 +32,6 @@
/// \defgroup flfile .fl Project File Operations
/// \{
-using namespace fld;
-using namespace fld::io;
-
/** \brief Write an .fl design description file.
The .fl file format is documented in `fluid/README_fl.txt`.
@@ -52,13 +49,13 @@ int fld::io::write_file(Project &proj, const char *filename, int selected_only,
// ---- Project_Writer ---------------------------------------------- MARK: -
/** \brief Construct local project writer. */
-Project_Writer::Project_Writer(Project &proj)
+fld::io::Project_Writer::Project_Writer(Project &proj)
: proj_(proj)
{
}
/** \brief Release project writer resources. */
-Project_Writer::~Project_Writer()
+fld::io::Project_Writer::~Project_Writer()
{
}
@@ -68,7 +65,7 @@ Project_Writer::~Project_Writer()
\param[in] s the filename or 0 for stdout
\return 1 if successful. 0 if the operation failed
*/
-int Project_Writer::open_write(const char *s) {
+int fld::io::Project_Writer::open_write(const char *s) {
if (!s) {
fout = stdout;
} else {
@@ -84,7 +81,7 @@ int Project_Writer::open_write(const char *s) {
Don't close, if data was sent to stdout.
\return 1 if succeeded, 0 if fclose failed
*/
-int Project_Writer::close_write() {
+int fld::io::Project_Writer::close_write() {
if (fout != stdout) {
int x = fclose(fout);
fout = stdout;
@@ -100,7 +97,7 @@ int Project_Writer::close_write() {
\param[in] sv if set, this file will be used by codeview
\return 0 if the operation failed, 1 if it succeeded
*/
-int Project_Writer::write_project(const char *filename, int selected_only, bool sv) {
+int fld::io::Project_Writer::write_project(const char *filename, int selected_only, bool sv) {
write_codeview_ = sv;
proj_.undo.suspend();
if (!open_write(filename)) {
@@ -131,7 +128,8 @@ int Project_Writer::write_project(const char *filename, int selected_only, bool
write_string("\nmergeback %d", proj_.write_mergeback_data);
}
- for (Node *p = proj_.tree.first; p;) {
+ Node *p;
+ for (p = proj_.tree.first; p;) {
if (!selected_only || p->selected) {
p->write(*this);
write_string("\n");
@@ -150,7 +148,7 @@ int Project_Writer::write_project(const char *filename, int selected_only, bool
Write a string to the .fl file, quoting characters if necessary.
\param[in] w NUL terminated text
*/
-void Project_Writer::write_word(const char *w) {
+void fld::io::Project_Writer::write_word(const char *w) {
if (needspace) putc(' ', fout);
needspace = 1;
if (!w || !*w) {fprintf(fout,"{}"); return;}
@@ -188,7 +186,7 @@ void Project_Writer::write_word(const char *w) {
unless the format starts with a newline character \\n.
\param[in] format printf style formatting string followed by a list of arguments
*/
-void Project_Writer::write_string(const char *format, ...) {
+void fld::io::Project_Writer::write_string(const char *format, ...) {
va_list args;
va_start(args, format);
if (needspace && *format != '\n') fputc(' ',fout);
@@ -201,7 +199,7 @@ void Project_Writer::write_string(const char *format, ...) {
Start a new line in the .fl file and indent it for a given nesting level.
\param[in] n indent level
*/
-void Project_Writer::write_indent(int n) {
+void fld::io::Project_Writer::write_indent(int n) {
fputc('\n',fout);
while (n--) {fputc(' ',fout); fputc(' ',fout);}
needspace = 0;
@@ -210,7 +208,7 @@ void Project_Writer::write_indent(int n) {
/**
Write a '{' to the .fl file at the given indenting level.
*/
-void Project_Writer::write_open() {
+void fld::io::Project_Writer::write_open() {
if (needspace) fputc(' ',fout);
fputc('{',fout);
needspace = 0;
@@ -220,7 +218,7 @@ void Project_Writer::write_open() {
Write a '}' to the .fl file at the given indenting level.
\param[in] n indent level
*/
-void Project_Writer::write_close(int n) {
+void fld::io::Project_Writer::write_close(int n) {
if (needspace) write_indent(n);
fputc('}',fout);
needspace = 1;