(file) Return to AssocClassTable.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository

Diff for /pegasus/src/Pegasus/Repository/AssocClassTable.cpp between version 1.25 and 1.26

version 1.25, 2007/07/06 13:50:36 version 1.26, 2007/10/17 20:37:28
Line 73 
Line 73 
     return false;     return false;
 } }
  
   
 static String _Escape(const String& str)  
 {  
     String result;  
   
     for (Uint32 i = 0, n = str.size(); i < n; i++)  
     {  
         Char16 c = str[i];  
   
         switch (c)  
         {  
             case '\n':  
                 result.append("\\n");  
                 break;  
   
             case '\r':  
                 result.append("\\r");  
                 break;  
   
             case '\t':  
                 result.append("\\t");  
                 break;  
   
             case '\f':  
                 result.append("\\f");  
                 break;  
   
             case '\\':  
                 result.append("\\\\");  
                 break;  
   
             default:  
                 result.append(c);  
         }  
     }  
   
     return result;  
 }  
   
 static String _Unescape(const String& str)  
 {  
     String result;  
   
     for (Uint32 i = 0, n = str.size(); i < n; i++)  
     {  
         Char16 c = str[i];  
   
         if (c == '\\')  
         {  
             if (i + 1 == n)  
                 break;  
   
             c = str[i + 1];  
   
             switch (c)  
             {  
                 case 'n':  
                     result.append("\n");  
                     break;  
   
                 case 'r':  
                     result.append("\r");  
                     break;  
   
                 case 't':  
                     result.append("\t");  
                     break;  
   
                 case 'f':  
                     result.append("\f");  
                     break;  
   
                 default:  
                     result.append(c);  
             }  
   
             i++;  
         }  
         else  
             result.append(c);  
     }  
   
     return result;  
 }  
   
 static Boolean _GetRecord(ifstream& is, Array<String>& fields) static Boolean _GetRecord(ifstream& is, Array<String>& fields)
 { {
     fields.clear();     fields.clear();
Line 185 
Line 100 
 { {
     for (Uint32 i = 0, n = fields.size(); i < n; i++)     for (Uint32 i = 0, n = fields.size(); i < n; i++)
     {     {
         // Calling getCString to ensure utf-8 goes to the file          // Write the field in UTF-8.  Call write() to ensure no data
         // Calling write to ensure no data conversion by the stream          // conversion by the stream.  Since all the fields contain CIM names,
         CString  buffer = _Escape(fields[i]).getCString();          // it is not necessary to escape CR/LF characters.
           CString buffer = fields[i].getCString();
         os.write((const char *)buffer,         os.write((const char *)buffer,
             static_cast<streamsize>(strlen((const char *)buffer)));             static_cast<streamsize>(strlen((const char *)buffer)));
         os << endl;         os << endl;


Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2