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

Unified Diff: webrtc/test/testsupport/iosfileutils.mm

Issue 2583853002: Remove duplicate implementations of string conversion methods. (Closed)
Patch Set: rebase Created 3 years, 11 months 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 | « webrtc/test/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/testsupport/iosfileutils.mm
diff --git a/webrtc/test/testsupport/iosfileutils.mm b/webrtc/test/testsupport/iosfileutils.mm
index 6bbe0823853fd39a926b85aa290e3569158c3f54..04ffd0fb574f9f85950049e28d139fedf1d652d7 100644
--- a/webrtc/test/testsupport/iosfileutils.mm
+++ b/webrtc/test/testsupport/iosfileutils.mm
@@ -19,25 +19,13 @@
#include "webrtc/base/checks.h"
#include "webrtc/typedefs.h"
+#include "webrtc/sdk/objc/Framework/Classes/helpers.h"
namespace webrtc {
namespace test {
-// TODO(henrika): move to shared location.
-// See https://code.google.com/p/webrtc/issues/detail?id=4773 for details.
-NSString* NSStringFromStdString(const std::string& stdString) {
- // std::string may contain null termination character so we construct
- // using length.
- return [[NSString alloc] initWithBytes:stdString.data()
- length:stdString.length()
- encoding:NSUTF8StringEncoding];
-}
-
-std::string StdStringFromNSString(NSString* nsString) {
- NSData* charData = [nsString dataUsingEncoding:NSUTF8StringEncoding];
- return std::string(reinterpret_cast<const char*>([charData bytes]),
- [charData length]);
-}
+using webrtc::ios::NSStringFromStdString;
+using webrtc::ios::StdStringFromNSString;
// For iOS, resource files are added to the application bundle in the root
// and not in separate folders as is the case for other platforms. This method
« no previous file with comments | « webrtc/test/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698