diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-01-18 17:12:25 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-24 23:18:34 +0100 |
commit | 149f6afe321ce59aebe4ce2f9dddd1881d0ac22b (patch) | |
tree | 45233b8c808ed553051799b38a6b1e73898db2e1 /src/declarative/qml/ftw/qhashedstring_p.h | |
parent | 49212ef6d8934a023e6d0a7b778ec25605a8be7a (diff) |
Allow JS API in modules
Allow modules to export verisoned javascript code into specified
namespaces.
Task-number: QTBUG-20857
Change-Id: Ic968c697ba36cbc4535870ed5eed2fe7f01af11d
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/declarative/qml/ftw/qhashedstring_p.h')
-rw-r--r-- | src/declarative/qml/ftw/qhashedstring_p.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/declarative/qml/ftw/qhashedstring_p.h b/src/declarative/qml/ftw/qhashedstring_p.h index 00c9e341ca..f4dd6ee87f 100644 --- a/src/declarative/qml/ftw/qhashedstring_p.h +++ b/src/declarative/qml/ftw/qhashedstring_p.h @@ -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) { |