Skip to content

Commit

Permalink
Add OGGraph.descriptionFormat API (#69)
Browse files Browse the repository at this point in the history
* Add OGGraph.descriptionFormat API

* Fix Linux build issue
  • Loading branch information
Kyle-Ye authored Apr 21, 2024
1 parent 036b8d2 commit acbee3c
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AGGraphDescription.h
//
//
// Created by Kyle on 2024/1/21.
//

#ifndef AGGraphDescription_h
#define AGGraphDescription_h

#include "AGBase.h"

AG_ASSUME_NONNULL_BEGIN

#if AG_OBJC_FOUNDATION
AG_EXTERN_C_BEGIN
AG_EXPORT
CFStringRef AGDescriptionFormat AG_SWIFT_NAME(AGGraphRef.descriptionFormat);
AG_EXTERN_C_END
#endif

AG_ASSUME_NONNULL_END

#endif /* AGGraphDescription_h */
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "AGDebugServer.h"
#include "AGGraph.h"
#include "AGGraphContext.h"
#include "AGGraphDescription.h"
#include "AGInputOptions.h"
#include "AGSearchOptions.h"
#include "AGSubgraph.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AGGraphDescription.h
//
//
// Created by Kyle on 2024/1/21.
//

#ifndef AGGraphDescription_h
#define AGGraphDescription_h

#include "AGBase.h"

AG_ASSUME_NONNULL_BEGIN

#if AG_OBJC_FOUNDATION
AG_EXTERN_C_BEGIN
AG_EXPORT
CFStringRef AGDescriptionFormat AG_SWIFT_NAME(AGGraphRef.descriptionFormat);
AG_EXTERN_C_END
#endif

AG_ASSUME_NONNULL_END

#endif /* AGGraphDescription_h */
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "AGDebugServer.h"
#include "AGGraph.h"
#include "AGGraphContext.h"
#include "AGGraphDescription.h"
#include "AGInputOptions.h"
#include "AGSearchOptions.h"
#include "AGSubgraph.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AGGraphDescription.h
//
//
// Created by Kyle on 2024/1/21.
//

#ifndef AGGraphDescription_h
#define AGGraphDescription_h

#include "AGBase.h"

AG_ASSUME_NONNULL_BEGIN

#if AG_OBJC_FOUNDATION
AG_EXTERN_C_BEGIN
AG_EXPORT
CFStringRef AGDescriptionFormat AG_SWIFT_NAME(AGGraphRef.descriptionFormat);
AG_EXTERN_C_END
#endif

AG_ASSUME_NONNULL_END

#endif /* AGGraphDescription_h */
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "AGDebugServer.h"
#include "AGGraph.h"
#include "AGGraphContext.h"
#include "AGGraphDescription.h"
#include "AGInputOptions.h"
#include "AGSearchOptions.h"
#include "AGSubgraph.h"
Expand Down
24 changes: 24 additions & 0 deletions AG/Sources/Headers/AGGraphDescription.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AGGraphDescription.h
//
//
// Created by Kyle on 2024/1/21.
//

#ifndef AGGraphDescription_h
#define AGGraphDescription_h

#include "AGBase.h"

AG_ASSUME_NONNULL_BEGIN

#if AG_OBJC_FOUNDATION
AG_EXTERN_C_BEGIN
AG_EXPORT
CFStringRef AGDescriptionFormat AG_SWIFT_NAME(AGGraphRef.descriptionFormat);
AG_EXTERN_C_END
#endif

AG_ASSUME_NONNULL_END

#endif /* AGGraphDescription_h */
1 change: 1 addition & 0 deletions AG/Sources/Headers/AttributeGraph-umbrella.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "AGDebugServer.h"
#include "AGGraph.h"
#include "AGGraphContext.h"
#include "AGGraphDescription.h"
#include "AGInputOptions.h"
#include "AGSearchOptions.h"
#include "AGSubgraph.h"
Expand Down
2 changes: 1 addition & 1 deletion Sources/_OpenGraph/Debug/og-debug-server.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "../Util/log.hpp"
#include "../Util/assert.hpp"
#include "../Graph/GraphDescription.hpp"
#include "../Graph/OGGraphDescription.h"
#include "../Graph/Graph.hpp"

#include <iostream>
Expand Down
20 changes: 0 additions & 20 deletions Sources/_OpenGraph/Graph/GraphDescription.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/_OpenGraph/Graph/GraphDescription.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kyle on 2024/1/21.
//

#include "GraphDescription.hpp"
#include "OGGraphDescription.h"
#include "OGGraph.h"
#include "Graph.hpp"
#include "../Util/assert.hpp"
Expand Down
24 changes: 24 additions & 0 deletions Sources/_OpenGraph/Graph/OGGraphDescription.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// OGGraphDescription.h
//
//
// Created by Kyle on 2024/1/21.
//

#ifndef OGGraphDescription_h
#define OGGraphDescription_h

#include "OGBase.h"

OG_ASSUME_NONNULL_BEGIN

#if OG_OBJC_FOUNDATION
OG_EXTERN_C_BEGIN
OG_EXPORT
CFStringRef OGDescriptionFormat OG_SWIFT_NAME(OGGraphRef.descriptionFormat);
OG_EXTERN_C_END
#endif

OG_ASSUME_NONNULL_END

#endif /* OGGraphDescription_h */
5 changes: 2 additions & 3 deletions Sources/_OpenGraph/OGBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@
#define OG_EXTERN_C_END CF_EXTERN_C_END
#define OG_ASSUME_NONNULL_BEGIN CF_ASSUME_NONNULL_BEGIN
#define OG_ASSUME_NONNULL_END CF_ASSUME_NONNULL_END
// TODO
//#define OG_IMPLICIT_BRIDGING_ENABLED CF_IMPLICIT_BRIDGING_ENABLED
//#define OG_IMPLICIT_BRIDGING_DISABLED CF_IMPLICIT_BRIDGING_DISABLED
#define OG_IMPLICIT_BRIDGING_ENABLED CF_IMPLICIT_BRIDGING_ENABLED
#define OG_IMPLICIT_BRIDGING_DISABLED CF_IMPLICIT_BRIDGING_DISABLED
#define OG_EXPORT CF_EXPORT
#define OG_BRIDGED_TYPE CF_BRIDGED_TYPE

Expand Down
1 change: 1 addition & 0 deletions Sources/_OpenGraph/include/OGGraphDescription.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// GraphDescriptionTests.swift
// OpenGraphCompatibilityTests

import Testing

#if canImport(Darwin)
struct GraphDescriptionTests {
@Test
func format() {
#expect(OGGraph.descriptionFormat.takeUnretainedValue() as String == "format")
}
}
#endif

0 comments on commit acbee3c

Please sign in to comment.