Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: ios/chrome/browser/ui/util/unicode_util.h

Issue 2580333003: Upstream Chrome on iOS source code [10/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/util/transparent_link_button.mm ('k') | ios/chrome/browser/ui/util/unicode_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/util/unicode_util.h
diff --git a/ios/chrome/browser/ui/util/unicode_util.h b/ios/chrome/browser/ui/util/unicode_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f0227c14ffa291e5d6689a0e5bc5e969fb3d58c
--- /dev/null
+++ b/ios/chrome/browser/ui/util/unicode_util.h
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_UTIL_UNICODE_UTIL_H_
+#define IOS_CHROME_BROWSER_UI_UTIL_UNICODE_UTIL_H_
+
+#import <UIKit/UIKit.h>
+
+namespace unicode_util {
+
+// Returns true if |c| is a character with R or AL bidirectionality as specified
+// by RFC 3454.
+bool IsCharRTL(unichar c);
+
+// Returns true if |c| is a character with L bidirectionality as specified by
+// RFC 3454.
+bool IsCharLTR(unichar c);
+
+// Returns the writing direction for |string| based on rules P2 and P3 of the
+// Unicode BiDi Algorithm. Returns NSWritingDirectionNatural for strings that
+// don't contain any bidirectionality information.
+NSWritingDirection UnicodeWritingDirectionForString(NSString* string);
+
+// Converts |string|'s characters to their unicode encodings (i.e. "\u" followed
+// by 4 hex digits). This is useful for creating string constants for RTL
+// languages without inducing RTL text layout when viewed in a text editor.
+NSString* GetEscapedUnicodeStringForString(NSString* string);
+
+} // namespace unicode_util
+
+#endif // IOS_CHROME_BROWSER_UI_UTIL_UNICODE_UTIL_H_
« no previous file with comments | « ios/chrome/browser/ui/util/transparent_link_button.mm ('k') | ios/chrome/browser/ui/util/unicode_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698