This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android] - replace platform default implementation using nunicode fo…
…r uppercasing an lowercasing with an Android specific String.java equivalent
- Loading branch information
Showing
5 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <mbgl/util/platform.hpp> | ||
#include "java/lang.hpp" | ||
#include "attach_env.hpp" | ||
|
||
namespace mbgl { | ||
namespace platform { | ||
|
||
std::string uppercase(const std::string& str) { | ||
auto env{ android::AttachEnv() }; | ||
auto jstring = jni::Make<jni::String>(*env, str.c_str()); | ||
return jni::Make<std::string>(*env, mbgl::android::java::lang::String::toUpperCase(*env, jstring)); | ||
} | ||
|
||
std::string lowercase(const std::string& str) { | ||
auto env{ android::AttachEnv() }; | ||
auto jstring = jni::Make<jni::String>(*env, str.c_str()); | ||
return jni::Make<std::string>(*env, mbgl::android::java::lang::String::toLowerCase(*env, jstring)); | ||
} | ||
|
||
} // namespace platform | ||
} // namespace mbgl |