File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed
Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 2020
2121public class SwiftCallingCpp {
2222 public init ( _ value: String ) {
23- CppInterfaceCalledBySwift . print ( std. string ( value) )
23+ firebase. CppInterfaceCalledBySwift. print ( std. string ( value) )
24+ firebase. CppInterfaceCalledBySwift. printTime ( firebase. Timestamp ( 56 , 32 ) )
2425 }
2526}
Original file line number Diff line number Diff line change 1818#define FIREBASE_USED_BY_SWIFT_H
1919
2020#include < string>
21+ #include " Firestore/core/include/firebase/firestore/timestamp.h"
2122
23+ namespace firebase {
2224class CppInterfaceCalledBySwift {
2325 public:
2426 static void print (std::string content);
27+ static void printTime (Timestamp time);
2528};
2629
30+ } // namespace firebase
2731#endif // FIREBASE_USED_BY_SWIFT_H
Original file line number Diff line number Diff line change 1717#include " ../include/used_by_swift.h"
1818#include < iostream>
1919
20- void CppInterfaceCalledBySwift::print (std::string content) {
20+ void firebase:: CppInterfaceCalledBySwift::print (std::string content) {
2121 std::cout << " C++ function runs with value: " << content << std::endl;
2222}
23+
24+ void firebase::CppInterfaceCalledBySwift::printTime (firebase::Timestamp time) {
25+ std::cout << " C++ function runs with value: " << time.ToString () << std::endl;
26+ }
Original file line number Diff line number Diff line change @@ -1411,6 +1411,7 @@ func firebaseFirestoreCppTarget() -> Target {
14111411 path: " Firestore/core/swift " ,
14121412 publicHeadersPath: " include " , // Path to the public headers
14131413 cxxSettings: [
1414+ . headerSearchPath( " ../../../ " ) ,
14141415 . headerSearchPath( " include " ) , // Ensure the header search path is correct
14151416 ]
14161417 )
You can’t perform that action at this time.
0 commit comments