File tree Expand file tree Collapse file tree 5 files changed +17
-9
lines changed
OpenGraphCxx/include/OpenGraph
Tests/OpenGraphCompatibilityTests/Graph Expand file tree Collapse file tree 5 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -112,8 +112,8 @@ extension Graph {
112112 public func archiveJSON( name: String ? ) {
113113 #if canImport(Darwin)
114114 let options : NSDictionary = [
115- Graph . descriptionFormat : " graph/dict " ,
116- Graph . descriptionIncludeValues : true ,
115+ DescriptionOption . format : " graph/dict " ,
116+ DescriptionOption . includeValues : true ,
117117 ]
118118 guard let description = Graph . description ( self , options: options) as? [ String : Any ] else {
119119 return
Original file line number Diff line number Diff line change @@ -16,11 +16,19 @@ OG_EXTERN_C_BEGIN
1616
1717#if OG_OBJC_FOUNDATION
1818
19+ typedef CFStringRef OGDescriptionOption OG_SWIFT_STRUCT OG_SWIFT_NAME (DescriptionOption );
20+
21+ OG_EXPORT
22+ const OGDescriptionOption OGDescriptionFormat OG_SWIFT_NAME (DescriptionOption .format );
23+
24+ OG_EXPORT
25+ const OGDescriptionOption OGDescriptionIncludeValues OG_SWIFT_NAME (DescriptionOption .includeValues );
26+
1927OG_EXPORT
20- const CFStringRef OGDescriptionFormat OG_SWIFT_NAME (OGGraphRef . descriptionFormat );
28+ const OGDescriptionOption OGDescriptionTruncationLimit OG_SWIFT_NAME (DescriptionOption . truncationLimit );
2129
2230OG_EXPORT
23- const CFStringRef OGDescriptionIncludeValues OG_SWIFT_NAME (OGGraphRef . descriptionIncludeValues );
31+ const OGDescriptionOption OGDescriptionMaxFrames OG_SWIFT_NAME (DescriptionOption . maxFrames );
2432
2533static const CFStringRef OGDescriptionFormatDot OG_SWIFT_NAME (OGGraphRef .descriptionFormatDot ) = CFSTR ("graph/dot" );
2634
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import Foundation
1010extension Graph {
1111 public var dict : [ String : Any ] ? {
1212 let options = [
13- Graph . descriptionFormat : Graph . descriptionFormatDictionary
13+ DescriptionOption . format : Graph . descriptionFormatDictionary
1414 ] as NSDictionary
1515 guard let description = Graph . description ( nil , options: options) else {
1616 return nil
@@ -28,7 +28,7 @@ extension Graph {
2828 // - red: is_changed
2929 public var dot : String ? {
3030 let options = [
31- Graph . descriptionFormat : Graph . descriptionFormatDot
31+ DescriptionOption . format : Graph . descriptionFormatDot
3232 ] as NSDictionary
3333 guard let description = Graph . description ( self , options: options)
3434 else {
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ struct GraphCompatibilityTests {
4343 let description = try #require( Graph . description (
4444 nil ,
4545 options: [
46- Graph . descriptionFormat : Graph . descriptionFormatDictionary
46+ DescriptionOption . format : Graph . descriptionFormatDictionary
4747 ] as NSDictionary
4848 ) )
4949 let dic = description as! Dictionary < String , AnyHashable >
@@ -54,7 +54,7 @@ struct GraphCompatibilityTests {
5454 @Test ( . disabled( if: !compatibilityTestEnabled, " Not implemented on OG " ) )
5555 func graphDescriptionDot( ) throws {
5656 let options = NSMutableDictionary ( )
57- options [ Graph . descriptionFormat ] = Graph . descriptionFormatDot
57+ options [ DescriptionOption . format ] = Graph . descriptionFormatDot
5858 #expect( Graph . description ( nil , options: options) == nil )
5959 let graph = Graph ( )
6060 let description = try #require( Graph . description ( graph, options: options) )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import Testing
88struct GraphDescriptionCompatibilityTests {
99 @Test
1010 func format( ) {
11- #expect( Graph . descriptionFormat as String == " format " )
11+ #expect( DescriptionOption . format . rawValue as String == " format " )
1212 }
1313}
1414#endif
You can’t perform that action at this time.
0 commit comments