CPPXT-104 - Add exception handling to integer conversions
[shibboleth/cpp-xmltooling.git] / xmltooling / unicode.h
index 1076abc..eb842c4 100644 (file)
@@ -1,17 +1,21 @@
-/*
- *  Copyright 2001-2009 Internet2
+/**
+ * Licensed to the University Corporation for Advanced Internet
+ * Development, Inc. (UCAID) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for
+ * additional information regarding copyright ownership.
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * UCAID licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the
+ * License at
  *
- *     http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the License.
  */
 
 /**
@@ -52,7 +56,7 @@ namespace xmltooling {
      *
      * @param src           the 16-bit string to transcode
      * @param use_malloc    true iff the result should be allocated with malloc, false to use new
-     * @return      a UTF-8 string allocated by the Xerces memory manager
+     * @return      a UTF-8 string allocated by new or malloc
      */
     extern XMLTOOL_API char* toUTF8(const XMLCh* src, bool use_malloc=false);
 
@@ -61,7 +65,7 @@ namespace xmltooling {
      *
      * @param src           the UTF-8 string to transcode
      * @param use_malloc    true iff the result should be allocated with malloc, false to use new
-     * @return      a 16-bit Unicode string allocated by the Xerces memory manager
+     * @return      a 16-bit Unicode string allocated by new or malloc
      */
     extern XMLTOOL_API XMLCh* fromUTF8(const char* src, bool use_malloc=false);
 
@@ -97,7 +101,7 @@ namespace xmltooling {
         /**
          * Default constructor.
          */
-        auto_ptr_char() : m_buf(NULL) {
+        auto_ptr_char() : m_buf(nullptr) {
         }
 
         /**
@@ -138,7 +142,7 @@ namespace xmltooling {
          * @return a null-terminated local code page string
          */
         char* release() {
-            char* temp=m_buf; m_buf=NULL; return temp;
+            char* temp=m_buf; m_buf=nullptr; return temp;
         }
 
     private:
@@ -159,7 +163,7 @@ namespace xmltooling {
         /**
          * Default constructor.
          */
-        auto_ptr_XMLCh() : m_buf(NULL) {
+        auto_ptr_XMLCh() : m_buf(nullptr) {
         }
 
         /**
@@ -200,7 +204,7 @@ namespace xmltooling {
          * @return a null-terminated Unicode string
          */
         XMLCh* release() {
-            XMLCh* temp=m_buf; m_buf=NULL; return temp;
+            XMLCh* temp=m_buf; m_buf=nullptr; return temp;
         }
 
     private:
@@ -247,7 +251,7 @@ namespace xmltooling {
          * @return the wrapped pointer
          */
         T* release() {
-            T* temp=m_ptr; m_ptr=NULL; return temp;
+            T* temp=m_ptr; m_ptr=nullptr; return temp;
         }
     };
 };