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

Diff for /pegasus/src/Pegasus/Common/CommonUTF.cpp between version 1.7 and 1.14

version 1.7, 2004/05/03 14:06:05 version 1.14, 2005/04/07 19:56:09
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 25 
Line 29 
 // //
 // Author: Dave Rosckes   (rosckes@us.ibm.com) // Author: Dave Rosckes   (rosckes@us.ibm.com)
 // //
   // Modified By: David Dillard, VERITAS Software Corp.
   //                  (david.dillard@veritas.com)
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
 #include <Pegasus/Common/Array.h> #include <Pegasus/Common/Array.h>
 #include "CommonUTF.h" #include "CommonUTF.h"
 #include <cctype>  
 #include <cstdio> #include <cstdio>
 #include <cstring> #include <cstring>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
  
 inline Uint8 _hexCharToNumeric(const Uint16 c)  inline Uint8 _hexCharToNumeric(Char16 c)
 { {
     Uint8 n;     Uint8 n;
  
Line 53 
Line 58 
 } }
  
 // Note: Caller must ensure that "src" contains "size" bytes. // Note: Caller must ensure that "src" contains "size" bytes.
 int isValid_U8(const Uint8 *src, int size)  Boolean isValid_U8(const Uint8 *src, int size)
 { {
     Uint8 U8_char;     Uint8 U8_char;
     const Uint8 *srcptr = src+size;     const Uint8 *srcptr = src+size;
Line 296 
Line 301 
     return (isValid_U8((const Uint8 *)legal, numBytes));     return (isValid_U8((const Uint8 *)legal, numBytes));
 } }
  
   Boolean isUTF8Str(const char *legal)
   {
       /*char tmp[] = {0xCE,0x99,0xCE,0xBF,0xCF,0x8D,0xCE,0xBD,0xCE,
                         0xB9,0xCE,0xBA,0xCE,0xBF,0xCE,0xBD,0xCF,0x84,
                         0x00};*/
   //  char tmp_[] = "class";
   //  char * tmp = legal;
       size_t count = 0;
       const size_t size = strlen(legal);
   //  printf("size = %d\n",size);
       while(count<size)
       {
   //      printf("count = %d\n",count);
           if(isUTF8(&legal[count]) == true){
               UTF8_NEXT(legal,count);
           }else{
   //          printf("bad string\n");
               return false;
           }
       }
   //  printf("good string\n");
       return true;
   /*
       printf("legal = %s\n\n", legal);
       Uint32 count = 0;
       Uint32 trailingBytes = 0;
           Uint32 size = strlen(legal);
       printf("size of legal is %d\n",size);
           while(count<size-1)
           {
           printf("count = %d\n", count);
                   if(isUTF8((char*)&legal[count]) == true){
                       UTF8_NEXT(legal,trailingBytes);
               count += trailingBytes;
           } else{
               printf("CommonUTF8:: returning false; position[%d]",count);
                return false;
           }
           }
        printf("CommonUTF8:: returning false; position[%d]",count);
       return true;*/
   }
  
 String escapeStringEncoder(const String& Str) String escapeStringEncoder(const String& Str)
 { {


Legend:
Removed from v.1.7  
changed lines
  Added in v.1.14

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2