| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 | 35 |
| 36 #if WEBKIT_IMPLEMENTATION | 36 #if WEBKIT_IMPLEMENTATION |
| 37 namespace WebCore { class String; class AtomicString; } | 37 namespace WebCore { class String; class AtomicString; } |
| 38 #else | 38 #else |
| 39 #include <base/string16.h> | 39 #include <base/string16.h> |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 namespace WebKit { | 42 namespace WebKit { |
| 43 | 43 class WebCString; |
| 44 class WebStringPrivate; | 44 class WebStringPrivate; |
| 45 | 45 |
| 46 // A UTF-16 string container. It is inexpensive to copy a WebString | 46 // A UTF-16 string container. It is inexpensive to copy a WebString |
| 47 // object. | 47 // object. |
| 48 // | 48 // |
| 49 // WARNING: It is not safe to pass a WebString across threads!!! | 49 // WARNING: It is not safe to pass a WebString across threads!!! |
| 50 // | 50 // |
| 51 class WebString { | 51 class WebString { |
| 52 public: | 52 public: |
| 53 ~WebString() { reset(); } | 53 ~WebString() { reset(); } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 70 WEBKIT_API void reset(); | 70 WEBKIT_API void reset(); |
| 71 WEBKIT_API void assign(const WebString&); | 71 WEBKIT_API void assign(const WebString&); |
| 72 WEBKIT_API void assign(const WebUChar* data, size_t len); | 72 WEBKIT_API void assign(const WebUChar* data, size_t len); |
| 73 | 73 |
| 74 WEBKIT_API size_t length() const; | 74 WEBKIT_API size_t length() const; |
| 75 WEBKIT_API const WebUChar* data() const; | 75 WEBKIT_API const WebUChar* data() const; |
| 76 | 76 |
| 77 bool isEmpty() const { return length() == 0; } | 77 bool isEmpty() const { return length() == 0; } |
| 78 bool isNull() const { return m_private == 0; } | 78 bool isNull() const { return m_private == 0; } |
| 79 | 79 |
| 80 WEBKIT_API WebCString utf8() const; |
| 81 |
| 80 WEBKIT_API static WebString fromUTF8(const char* data, size_t length); | 82 WEBKIT_API static WebString fromUTF8(const char* data, size_t length); |
| 81 WEBKIT_API static WebString fromUTF8(const char* data); | 83 WEBKIT_API static WebString fromUTF8(const char* data); |
| 82 | 84 |
| 83 #if WEBKIT_IMPLEMENTATION | 85 #if WEBKIT_IMPLEMENTATION |
| 84 WebString(const WebCore::String&); | 86 WebString(const WebCore::String&); |
| 85 WebString& operator=(const WebCore::String&); | 87 WebString& operator=(const WebCore::String&); |
| 86 operator WebCore::String() const; | 88 operator WebCore::String() const; |
| 87 WebString(const WebCore::AtomicString&); | 89 WebString(const WebCore::AtomicString&); |
| 88 WebString& operator=(const WebCore::AtomicString&); | 90 WebString& operator=(const WebCore::AtomicString&); |
| 89 operator WebCore::AtomicString() const; | 91 operator WebCore::AtomicString() const; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 113 #endif | 115 #endif |
| 114 | 116 |
| 115 private: | 117 private: |
| 116 void assign(WebStringPrivate*); | 118 void assign(WebStringPrivate*); |
| 117 WebStringPrivate* m_private; | 119 WebStringPrivate* m_private; |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace WebKit | 122 } // namespace WebKit |
| 121 | 123 |
| 122 #endif | 124 #endif |
| OLD | NEW |