Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / ftw / qhashedstring_p.h
index 2fddf24..6848599 100644 (file)
@@ -1,8 +1,7 @@
 /****************************************************************************
 **
 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
 **
 ** This file is part of the QtDeclarative module of the Qt Toolkit.
 **
@@ -35,6 +34,7 @@
 **
 **
 **
+**
 ** $QT_END_LICENSE$
 **
 ****************************************************************************/
@@ -104,6 +104,8 @@ public:
 
     inline v8::Handle<v8::String> string() const;
 
+    inline QString toString() const;
+
 private:
     v8::String::CompleteHashData m_hash;
     v8::Handle<v8::String> m_string;
@@ -917,6 +919,17 @@ v8::Handle<v8::String> QHashedV8String::string() const
     return m_string;
 }
 
+QString QHashedV8String::toString() const
+{
+    QString result;
+    result.reserve(m_hash.length);
+
+    for (int i = 0; i < m_hash.length; ++i)
+        result.append(m_string->GetCharacter(i));
+
+    return result;
+}
+
 QHashedStringRef::QHashedStringRef() 
 : m_data(0), m_length(0), m_utf8length(-1), m_hash(0) 
 {