C++ 17 style nested namespaces (#1326)
Summary: X-link: https://github.com/facebook/react-native/pull/38304 Pull Request resolved: https://github.com/facebook/yoga/pull/1326 For better readability Reviewed By: christophpurrer Differential Revision: D47384926 fbshipit-source-id: 2f60d50a185331b3624d45d1fc45f98d504b3034
This commit is contained in:
committed by
Facebook GitHub Bot
parent
423dc155d8
commit
660edcec20
@@ -12,9 +12,7 @@
|
||||
#include <type_traits>
|
||||
#include "corefunctions.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
/**
|
||||
* ScopedGlobalRef is a sort of smart reference that allows us to control the
|
||||
@@ -132,6 +130,4 @@ ScopedGlobalRef<T> make_global_ref(T globalRef) {
|
||||
return ScopedGlobalRef<T>(globalRef);
|
||||
}
|
||||
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -15,9 +15,7 @@
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
/**
|
||||
* ScopedLocalRef is a sort of smart reference that allows us to control the
|
||||
@@ -132,6 +130,4 @@ ScopedLocalRef<T> make_local_ref(JNIEnv* env, T localRef) {
|
||||
return ScopedLocalRef<T>(env, localRef);
|
||||
}
|
||||
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -10,9 +10,7 @@
|
||||
#include "YogaJniException.h"
|
||||
#include "common.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
YogaJniException::YogaJniException() {
|
||||
jclass cl = getCurrentEnv()->FindClass("java/lang/RuntimeException");
|
||||
@@ -47,6 +45,5 @@ ScopedLocalRef<jthrowable> YogaJniException::getThrowable() const noexcept {
|
||||
getCurrentEnv(),
|
||||
static_cast<jthrowable>(getCurrentEnv()->NewLocalRef(throwable_.get())));
|
||||
}
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -9,9 +9,7 @@
|
||||
#include <string>
|
||||
#include "common.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
/**
|
||||
* This class wraps a Java exception (jthrowable) into a C++ exception; A global
|
||||
* reference to Java exception (jthrowable) is made so that the exception object
|
||||
@@ -33,6 +31,5 @@ public:
|
||||
private:
|
||||
ScopedGlobalRef<jthrowable> throwable_;
|
||||
};
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -7,9 +7,7 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
void registerNatives(
|
||||
JNIEnv* env,
|
||||
@@ -109,6 +107,5 @@ ScopedGlobalRef<jthrowable> newGlobalRef(JNIEnv* env, jthrowable obj) {
|
||||
|
||||
return make_global_ref(result);
|
||||
}
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -9,9 +9,7 @@
|
||||
#include "ScopedGlobalRef.h"
|
||||
#include "ScopedLocalRef.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
/**
|
||||
* Registers a set of methods for a JNI class. Aborts if registration fails.
|
||||
@@ -74,6 +72,5 @@ ScopedLocalRef<jobject> callStaticObjectMethod(
|
||||
ScopedGlobalRef<jobject> newGlobalRef(JNIEnv* env, jobject obj);
|
||||
|
||||
ScopedGlobalRef<jthrowable> newGlobalRef(JNIEnv* env, jthrowable obj);
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -9,9 +9,7 @@
|
||||
#include "macros.h"
|
||||
#include "YogaJniException.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
namespace {
|
||||
JavaVM* globalVm = NULL;
|
||||
@@ -90,6 +88,4 @@ void assertNoPendingJniExceptionIf(JNIEnv* env, bool condition) {
|
||||
throw YogaJniException();
|
||||
}
|
||||
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
@@ -10,9 +10,7 @@
|
||||
#include <jni.h>
|
||||
#include <cstddef>
|
||||
|
||||
namespace facebook {
|
||||
namespace yoga {
|
||||
namespace vanillajni {
|
||||
namespace facebook::yoga::vanillajni {
|
||||
|
||||
/**
|
||||
* This method has to be called before using the vanillajni library. This method
|
||||
@@ -49,6 +47,4 @@ void assertNoPendingJniException(JNIEnv* env);
|
||||
|
||||
void assertNoPendingJniExceptionIf(JNIEnv* env, bool condition);
|
||||
|
||||
} // namespace vanillajni
|
||||
} // namespace yoga
|
||||
} // namespace facebook
|
||||
} // namespace facebook::yoga::vanillajni
|
||||
|
Reference in New Issue
Block a user