diff options
Diffstat (limited to 'fluid/io/Code_Writer.cxx')
| -rw-r--r-- | fluid/io/Code_Writer.cxx | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/fluid/io/Code_Writer.cxx b/fluid/io/Code_Writer.cxx index ffa63514a..f81da6ca7 100644 --- a/fluid/io/Code_Writer.cxx +++ b/fluid/io/Code_Writer.cxx @@ -141,7 +141,7 @@ int is_id(char c) { \param[in] label else if label is set, it is appended, skipping non-keyword characters \return buffer to a unique identifier, managed by Code_Writer, so caller must NOT free() it */ -const char* fld::io::Code_Writer::unique_id(void* o, const char* type, const char* name, const char* label) { +const char* Code_Writer::unique_id(void* o, const char* type, const char* name, const char* label) { char buffer[128]; char* q = buffer; char* q_end = q + 128 - 8 - 1; // room for hex number and NUL @@ -186,7 +186,7 @@ const char* fld::io::Code_Writer::unique_id(void* o, const char* type, const cha \param[in] set generate this indent depth \return pointer to a static string */ -const char *fld::io::Code_Writer::indent(int set) { +const char *Code_Writer::indent(int set) { static const char* spaces = " "; int i = set * 2; if (i>64) i = 64; @@ -198,7 +198,7 @@ const char *fld::io::Code_Writer::indent(int set) { Return a C string that indents code to the current source file depth. \return pointer to a static string */ -const char *fld::io::Code_Writer::indent() { +const char *Code_Writer::indent() { return indent(indentation); } @@ -208,7 +208,7 @@ const char *fld::io::Code_Writer::indent() { change the `indentation` variable; offset can be negative \return pointer to a static string */ -const char *fld::io::Code_Writer::indent_plus(int offset) { +const char *Code_Writer::indent_plus(int offset) { return indent(indentation+offset); } @@ -219,7 +219,7 @@ const char *fld::io::Code_Writer::indent_plus(int offset) { \param[in] format printf-style formatting text, followed by a vararg list \return 1 if the text was written to the file, 0 if it was previously written. */ -int fld::io::Code_Writer::write_h_once(const char *format, ...) { +int Code_Writer::write_h_once(const char *format, ...) { va_list args; char buf[1024]; va_start(args, format); @@ -239,7 +239,7 @@ int fld::io::Code_Writer::write_h_once(const char *format, ...) { \param[in] format printf-style formatting text, followed by a vararg list \return 1 if the text was written to the file, 0 if it was previously written. */ -int fld::io::Code_Writer::write_c_once(const char *format, ...) { +int Code_Writer::write_c_once(const char *format, ...) { va_list args; char buf[1024]; va_start(args, format); @@ -264,7 +264,7 @@ int fld::io::Code_Writer::write_c_once(const char *format, ...) { \param[in] pp ay pointer \return true if found in the tree, false if added to the tree */ -bool fld::io::Code_Writer::c_contains(void *pp) { +bool Code_Writer::c_contains(void *pp) { if (ptr_in_code.contains(pp)) { return true; } @@ -289,7 +289,7 @@ bool fld::io::Code_Writer::c_contains(void *pp) { \see f.write_cstring(const char*) */ -void fld::io::Code_Writer::write_cstring(const char *s, int length) { +void Code_Writer::write_cstring(const char *s, int length) { const char *next_line = "\"\n\""; if (varused_test) { varused = 1; @@ -370,7 +370,7 @@ void fld::io::Code_Writer::write_cstring(const char *s, int length) { \param[in] s write this string \see f.write_cstring(const char*, int) */ -void fld::io::Code_Writer::write_cstring(const char *s) { +void Code_Writer::write_cstring(const char *s) { write_cstring(s, (int)strlen(s)); } @@ -382,7 +382,7 @@ void fld::io::Code_Writer::write_cstring(const char *s) { \param[in] s a block of binary data, interpreted as unsigned bytes \param[in] length size of the block in bytes */ -void fld::io::Code_Writer::write_cdata(const char *s, int length) { +void Code_Writer::write_cdata(const char *s, int length) { if (varused_test) { varused = 1; return; @@ -420,7 +420,7 @@ void fld::io::Code_Writer::write_cdata(const char *s, int length) { \param[in] format printf-style formatting text \param[in] args list of arguments */ -void fld::io::Code_Writer::vwrite_c(const char* format, va_list args) { +void Code_Writer::vwrite_c(const char* format, va_list args) { if (varused_test) { varused = 1; return; @@ -432,7 +432,7 @@ void fld::io::Code_Writer::vwrite_c(const char* format, va_list args) { Print a formatted line to the source file. \param[in] format printf-style formatting text, followed by a vararg list */ -void fld::io::Code_Writer::write_c(const char* format,...) { +void Code_Writer::write_c(const char* format,...) { va_list args; va_start(args, format); vwrite_c(format, args); @@ -447,7 +447,7 @@ void fld::io::Code_Writer::write_c(const char* format,...) { \param[in] c line of code \param[in] com optional commentary */ -void fld::io::Code_Writer::write_cc(const char *indent, int n, const char *c, const char *com) { +void Code_Writer::write_cc(const char *indent, int n, const char *c, const char *com) { write_c("%s%.*s", indent, n, c); char cc = c[n-1]; if (cc!='}' && cc!=';') @@ -461,7 +461,7 @@ void fld::io::Code_Writer::write_cc(const char *indent, int n, const char *c, co Print a formatted line to the header file. \param[in] format printf-style formatting text, followed by a vararg list */ -void fld::io::Code_Writer::write_h(const char* format,...) { +void Code_Writer::write_h(const char* format,...) { if (varused_test) return; va_list args; va_start(args, format); @@ -477,7 +477,7 @@ void fld::io::Code_Writer::write_h(const char* format,...) { \param[in] c line of code \param[in] com optional commentary */ -void fld::io::Code_Writer::write_hc(const char *indent, int n, const char* c, const char *com) { +void Code_Writer::write_hc(const char *indent, int n, const char* c, const char *com) { write_h("%s%.*s", indent, n, c); char cc = c[n-1]; if (cc!='}' && cc!=';') @@ -494,7 +494,7 @@ void fld::io::Code_Writer::write_hc(const char *indent, int n, const char* c, co \param[in] inTrailWith append this character if the last line did not end with a newline, usually 0 or newline. */ -void fld::io::Code_Writer::write_c_indented(const char *textlines, int inIndent, char inTrailWith) { +void Code_Writer::write_c_indented(const char *textlines, int inIndent, char inTrailWith) { if (textlines) { indentation += inIndent; for (;;) { @@ -567,7 +567,7 @@ bool is_comment_before_class_member(Node *q) { \param[in] p write this type and all its children \return pointer to the next sibling */ -Node* fld::io::Code_Writer::write_static(Node* p) { +Node* Code_Writer::write_static(Node* p) { if (write_codeview) p->header_static_start = (int)ftell(header_file); if (write_codeview) p->code_static_start = (int)ftell(code_file); p->write_static(*this); @@ -589,7 +589,7 @@ Node* fld::io::Code_Writer::write_static(Node* p) { \param[in] p write this node and all its children \return pointer to the next sibling */ -Node* fld::io::Code_Writer::write_code(Node* p) { +Node* Code_Writer::write_code(Node* p) { // write all code that comes before the children code // (but don't write the last comment until the very end) if (!(p==Fluid.proj.tree.last && p->is_a(FLD_NODE_TYPE_Comment))) { @@ -658,7 +658,7 @@ Node* fld::io::Code_Writer::write_code(Node* p) { \param[in] t filename of the header file \return 0 if the operation failed, 1 if it was successful */ -int fld::io::Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { +int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) { write_codeview = to_codeview; unique_id_list.clear(); indentation = 0; @@ -873,7 +873,7 @@ int fld::io::Code_Writer::write_code(const char *s, const char *t, bool to_codev This avoids repeating these words if the mode is already set. \param[in] state 0 for private, 1 for public, 2 for protected */ -void fld::io::Code_Writer::write_public(int state) { +void Code_Writer::write_public(int state) { if (!current_class && !current_widget_class) return; if (current_class && current_class->write_public_state == state) return; if (current_widget_class && current_widget_class->write_public_state == state) return; @@ -889,7 +889,7 @@ void fld::io::Code_Writer::write_public(int state) { /** Create and initialize a new C++ source code writer. */ -fld::io::Code_Writer::Code_Writer(Project &proj) +Code_Writer::Code_Writer(Project &proj) : proj_ { proj } { block_crc_ = crc32(0, 0, 0); @@ -898,7 +898,7 @@ fld::io::Code_Writer::Code_Writer(Project &proj) /** Release all resources. */ -fld::io::Code_Writer::~Code_Writer() +Code_Writer::~Code_Writer() { if (block_buffer_) ::free(block_buffer_); } @@ -911,7 +911,7 @@ fld::io::Code_Writer::~Code_Writer() \param[in] type FD_TAG_GENERIC, FD_TAG_CODE, FD_TAG_MENU_CALLBACK, or FD_TAG_WIDGET_CALLBACK \param[in] uid the unique id of the current type */ -void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_type, unsigned short uid) { +void Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_type, unsigned short uid) { if (proj_.write_mergeback_data) { ::Mergeback::print_tag(code_file, prev_type, next_type, uid, (uint32_t)block_crc_); } @@ -929,7 +929,7 @@ void fld::io::Code_Writer::tag(Mergeback::Tag prev_type, Mergeback::Tag next_typ if we are the start of a line, used to find leading whitespace \return the new CRC */ -unsigned long fld::io::Code_Writer::block_crc(const void *data, int n, unsigned long in_crc, bool *inout_line_start) { +unsigned long Code_Writer::block_crc(const void *data, int n, unsigned long in_crc, bool *inout_line_start) { if (!data) return 0; if (n==-1) n = (int)strlen((const char*)data); bool line_start = true; @@ -956,7 +956,7 @@ unsigned long fld::io::Code_Writer::block_crc(const void *data, int n, unsigned \param[in] data a pointer to the data block \param[in] n the size of the data in bytes, or -1 to use strlen() */ -void fld::io::Code_Writer::crc_add(const void *data, int n) { +void Code_Writer::crc_add(const void *data, int n) { block_crc_ = block_crc(data, n, block_crc_, &block_line_start_); } @@ -965,7 +965,7 @@ void fld::io::Code_Writer::crc_add(const void *data, int n) { \param[in] format printf style formatting string \return see fprintf(FILE *, *const char*, ...) */ -int fld::io::Code_Writer::crc_printf(const char *format, ...) { +int Code_Writer::crc_printf(const char *format, ...) { va_list args; va_start(args, format); int ret = crc_vprintf(format, args); @@ -979,7 +979,7 @@ int fld::io::Code_Writer::crc_printf(const char *format, ...) { \param[in] args list of arguments \return see fprintf(FILE *, *const char*, ...) */ -int fld::io::Code_Writer::crc_vprintf(const char *format, va_list args) { +int Code_Writer::crc_vprintf(const char *format, va_list args) { if (proj_.write_mergeback_data) { int n = vsnprintf(block_buffer_, block_buffer_size_, format, args); if (n > block_buffer_size_) { @@ -1000,7 +1000,7 @@ int fld::io::Code_Writer::crc_vprintf(const char *format, va_list args) { \param[in] text any text, no requirements to end in a newline or such \return see fputs(const char*, FILE*) */ -int fld::io::Code_Writer::crc_puts(const char *text) { +int Code_Writer::crc_puts(const char *text) { if (proj_.write_mergeback_data) { crc_add(text); } @@ -1009,11 +1009,11 @@ int fld::io::Code_Writer::crc_puts(const char *text) { /** Write a single ASCII character to the code file. If MergeBack is enabled, the CRC calculation is continued. - \note to write UTF-8 characters, use fld::io::Code_Writer::crc_puts(const char *text) + \note to write UTF-8 characters, use Code_Writer::crc_puts(const char *text) \param[in] c any character between 0 and 127 inclusive \return see fputc(int, FILE*) */ -int fld::io::Code_Writer::crc_putc(int c) { +int Code_Writer::crc_putc(int c) { if (proj_.write_mergeback_data) { uchar uc = (uchar)c; crc_add(&uc, 1); |
