Author: rfm
Date: Tue Jul 19 14:33:26 2016
New Revision: 40014

URL: http://svn.gna.org/viewcvs/gnustep?rev=40014&view=rev
Log:
add setCRLF method

Modified:
    libs/webservices/trunk/GWSCoder.h
    libs/webservices/trunk/GWSCoder.m

Modified: libs/webservices/trunk/GWSCoder.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webservices/trunk/GWSCoder.h?rev=40014&r1=40013&r2=40014&view=diff
==============================================================================
--- libs/webservices/trunk/GWSCoder.h   (original)
+++ libs/webservices/trunk/GWSCoder.h   Tue Jul 19 14:33:26 2016
@@ -85,6 +85,7 @@
   BOOL                 _debug;         // YES if debug is enabled.
   BOOL                 _fault;         // YES while building a fault.
   BOOL                  _oldparser;     // YES if no namespace support.
+  BOOL                  _crlf;          // YES to use CRLF rather than LF
   unsigned              _level;         // Current indentation level.
   NSMutableString       *_ms;           // Not retained.
   id                    _delegate;      // Not retained.
@@ -150,7 +151,9 @@
 
 /** Add a new line to the temporary string currently in use for
  * creating an XML document, and add padding on the new line so
- * that the next item written is indented correctly.
+ * that the next item written is indented correctly.<br />
+ * A newline is a linefeed (LF) character unless the -setCRLF
+ * method is used to override that.
  */
 - (void) nl;
 
@@ -187,6 +190,11 @@
  * slow/low bandwidth connections), but sacrifices readability.
  */
 - (void) setCompact: (BOOL)flag;
+
+/** Specifies whether newlines are represented as a single LF or as a
+ * CRLF sequence when generating output.
+ */
+- (void) setCRLF: (BOOL)flag;
 
 /** Specifies whether debug information is enabled.  See -debug for more
  * information.

Modified: libs/webservices/trunk/GWSCoder.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webservices/trunk/GWSCoder.m?rev=40014&r1=40013&r2=40014&view=diff
==============================================================================
--- libs/webservices/trunk/GWSCoder.m   (original)
+++ libs/webservices/trunk/GWSCoder.m   Tue Jul 19 14:33:26 2016
@@ -706,7 +706,14 @@
     {
       unsigned  index;
 
-      [_ms appendString: @"\n"];
+      if (YES == _crlf)
+        {
+          [_ms appendString: @"\r\n"];
+        }
+      else
+        {
+          [_ms appendString: @"\n"];
+        }
       if ((index = _level) > 0)
         {
           if (index > sizeof(indentations)/sizeof(*indentations))
@@ -1091,6 +1098,11 @@
   _compact = flag;
 }
 
+- (void) setCRLF: (BOOL)flag
+{
+  _crlf = flag;
+}
+
 - (void) setDebug: (BOOL)flag
 {
   _debug = flag;


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to