chordsketch 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1bbee78306f1a5f249a62d93dc550a41dff635e4ec958ee8a189333fb00afec
4
- data.tar.gz: 7f56a1316b6e426565ce5c1bba3bea7da2b89d4deeb97d0cf0c0915611f7ebbb
3
+ metadata.gz: 57dd3a5af6ad2e427b6dc592926fbe87db779ed6f71160a8df5b6ad04c3583cd
4
+ data.tar.gz: 390d6396b4a9ddb2510ef3ec0752b1c15d1e421b4039cd2074d98dfa4b409adc
5
5
  SHA512:
6
- metadata.gz: b16b986ce0ed673e3325ab38fea3bfdf711b469b9b4261b36380eedd165a0ebad6a5595bc32dde37ec693917e67bea29b7904c7cd8df1942c3a19749fb3c6fb9
7
- data.tar.gz: e6673576a4e6560943353a260b2ac0a3a45c34b15ffb1cc3b4ace506e96e9a93b1629343b955fa1c670592f0ef49ede427b668087af9249459054ed067f74ba8
6
+ metadata.gz: 33d74dcae87ab139d2be40d42ef4278a110d51f2365160ba68299058cc0c69eb6c0862c2c3267ca14af400d9ade10f704f29c5fcf46c1463e1def6eabb8b0a88
7
+ data.tar.gz: 4735ee9a957e532079698f5a6d238849f840fce0dab687bbd1f79caa5516ee8018ebcd3f26d70d5bd284dd4a5cfaf6ded00b6bb0f6f01e56521fcda0a9a54d9a
@@ -126,6 +126,26 @@ end
126
126
  end
127
127
  end
128
128
 
129
+ # The Record type ConversionWithWarnings.
130
+
131
+ def self.check_lower_TypeConversionWithWarnings(v)
132
+
133
+ RustBuffer.check_lower_Sequencestring(v.warnings)
134
+ end
135
+
136
+ def self.alloc_from_TypeConversionWithWarnings(v)
137
+ RustBuffer.allocWithBuilder do |builder|
138
+ builder.write_TypeConversionWithWarnings(v)
139
+ return builder.finalize
140
+ end
141
+ end
142
+
143
+ def consumeIntoTypeConversionWithWarnings
144
+ consumeWithStream do |stream|
145
+ return stream.readTypeConversionWithWarnings
146
+ end
147
+ end
148
+
129
149
  # The Record type PdfRenderWithWarnings.
130
150
 
131
151
  def self.check_lower_TypePdfRenderWithWarnings(v)
@@ -343,6 +363,15 @@ class RustBufferStream
343
363
  read(size).force_encoding(Encoding::BINARY)
344
364
  end
345
365
 
366
+ # The Record type ConversionWithWarnings.
367
+
368
+ def readTypeConversionWithWarnings
369
+ ConversionWithWarnings.new(
370
+ output: readString,
371
+ warnings: readSequencestring
372
+ )
373
+ end
374
+
346
375
  # The Record type PdfRenderWithWarnings.
347
376
 
348
377
  def readTypePdfRenderWithWarnings
@@ -388,6 +417,11 @@ class RustBufferStream
388
417
  readString()
389
418
  )
390
419
  end
420
+ if variant == 3
421
+ return ChordSketchError::ConversionFailed.new(
422
+ readString()
423
+ )
424
+ end
391
425
 
392
426
  raise InternalError, 'Unexpected variant tag for TypeChordSketchError'
393
427
  end
@@ -521,6 +555,13 @@ class RustBufferBuilder
521
555
  write v
522
556
  end
523
557
 
558
+ # The Record type ConversionWithWarnings.
559
+
560
+ def write_TypeConversionWithWarnings(v)
561
+ self.write_String(v.output)
562
+ self.write_Sequencestring(v.warnings)
563
+ end
564
+
524
565
  # The Record type PdfRenderWithWarnings.
525
566
 
526
567
  def write_TypePdfRenderWithWarnings(v)
@@ -653,6 +694,19 @@ module ChordSketchError
653
694
  attr_reader :reason
654
695
 
655
696
 
697
+ def to_s
698
+ "#{self.class.name}(reason=#{@reason.inspect})"
699
+ end
700
+ end
701
+ class ConversionFailed < StandardError
702
+ def initialize(reason)
703
+ @reason = reason
704
+ super()
705
+ end
706
+
707
+ attr_reader :reason
708
+
709
+
656
710
  def to_s
657
711
  "#{self.class.name}(reason=#{@reason.inspect})"
658
712
  end
@@ -738,9 +792,21 @@ module UniFFILib
738
792
  attach_function :uniffi_chordsketch_ffi_fn_func_chord_diagram_svg,
739
793
  [RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
740
794
  RustBuffer.by_value
795
+ attach_function :uniffi_chordsketch_ffi_fn_func_convert_chordpro_to_irealb,
796
+ [RustBuffer.by_value, RustCallStatus.by_ref],
797
+ RustBuffer.by_value
798
+ attach_function :uniffi_chordsketch_ffi_fn_func_convert_irealb_to_chordpro_text,
799
+ [RustBuffer.by_value, RustCallStatus.by_ref],
800
+ RustBuffer.by_value
741
801
  attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html,
742
802
  [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
743
803
  RustBuffer.by_value
804
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body,
805
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
806
+ RustBuffer.by_value
807
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body_with_warnings,
808
+ [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
809
+ RustBuffer.by_value
744
810
  attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_html_with_warnings,
745
811
  [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
746
812
  RustBuffer.by_value
@@ -756,6 +822,27 @@ module UniFFILib
756
822
  attach_function :uniffi_chordsketch_ffi_fn_func_parse_and_render_text_with_warnings,
757
823
  [RustBuffer.by_value, RustBuffer.by_value, RustBuffer.by_value, RustCallStatus.by_ref],
758
824
  RustBuffer.by_value
825
+ attach_function :uniffi_chordsketch_ffi_fn_func_parse_irealb,
826
+ [RustBuffer.by_value, RustCallStatus.by_ref],
827
+ RustBuffer.by_value
828
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_html_css,
829
+ [RustCallStatus.by_ref],
830
+ RustBuffer.by_value
831
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_html_css_with_config_json,
832
+ [RustBuffer.by_value, RustCallStatus.by_ref],
833
+ RustBuffer.by_value
834
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_ireal_pdf,
835
+ [RustBuffer.by_value, RustCallStatus.by_ref],
836
+ RustBuffer.by_value
837
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_ireal_png,
838
+ [RustBuffer.by_value, RustCallStatus.by_ref],
839
+ RustBuffer.by_value
840
+ attach_function :uniffi_chordsketch_ffi_fn_func_render_ireal_svg,
841
+ [RustBuffer.by_value, RustCallStatus.by_ref],
842
+ RustBuffer.by_value
843
+ attach_function :uniffi_chordsketch_ffi_fn_func_serialize_irealb,
844
+ [RustBuffer.by_value, RustCallStatus.by_ref],
845
+ RustBuffer.by_value
759
846
  attach_function :uniffi_chordsketch_ffi_fn_func_validate,
760
847
  [RustBuffer.by_value, RustCallStatus.by_ref],
761
848
  RustBuffer.by_value
@@ -777,9 +864,21 @@ module UniFFILib
777
864
  attach_function :uniffi_chordsketch_ffi_checksum_func_chord_diagram_svg,
778
865
  [RustCallStatus.by_ref],
779
866
  :uint16
867
+ attach_function :uniffi_chordsketch_ffi_checksum_func_convert_chordpro_to_irealb,
868
+ [RustCallStatus.by_ref],
869
+ :uint16
870
+ attach_function :uniffi_chordsketch_ffi_checksum_func_convert_irealb_to_chordpro_text,
871
+ [RustCallStatus.by_ref],
872
+ :uint16
780
873
  attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html,
781
874
  [RustCallStatus.by_ref],
782
875
  :uint16
876
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html_body,
877
+ [RustCallStatus.by_ref],
878
+ :uint16
879
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html_body_with_warnings,
880
+ [RustCallStatus.by_ref],
881
+ :uint16
783
882
  attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_html_with_warnings,
784
883
  [RustCallStatus.by_ref],
785
884
  :uint16
@@ -795,6 +894,27 @@ module UniFFILib
795
894
  attach_function :uniffi_chordsketch_ffi_checksum_func_parse_and_render_text_with_warnings,
796
895
  [RustCallStatus.by_ref],
797
896
  :uint16
897
+ attach_function :uniffi_chordsketch_ffi_checksum_func_parse_irealb,
898
+ [RustCallStatus.by_ref],
899
+ :uint16
900
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_html_css,
901
+ [RustCallStatus.by_ref],
902
+ :uint16
903
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_html_css_with_config_json,
904
+ [RustCallStatus.by_ref],
905
+ :uint16
906
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_ireal_pdf,
907
+ [RustCallStatus.by_ref],
908
+ :uint16
909
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_ireal_png,
910
+ [RustCallStatus.by_ref],
911
+ :uint16
912
+ attach_function :uniffi_chordsketch_ffi_checksum_func_render_ireal_svg,
913
+ [RustCallStatus.by_ref],
914
+ :uint16
915
+ attach_function :uniffi_chordsketch_ffi_checksum_func_serialize_irealb,
916
+ [RustCallStatus.by_ref],
917
+ :uint16
798
918
  attach_function :uniffi_chordsketch_ffi_checksum_func_validate,
799
919
  [RustCallStatus.by_ref],
800
920
  :uint16
@@ -811,6 +931,27 @@ end
811
931
 
812
932
 
813
933
 
934
+ # Record type ConversionWithWarnings
935
+ class ConversionWithWarnings
936
+ attr_reader :output, :warnings
937
+
938
+ def initialize(output:, warnings:)
939
+ @output = output
940
+ @warnings = warnings
941
+ end
942
+
943
+ def ==(other)
944
+ if @output != other.output
945
+ return false
946
+ end
947
+ if @warnings != other.warnings
948
+ return false
949
+ end
950
+
951
+ true
952
+ end
953
+ end
954
+
814
955
  # Record type PdfRenderWithWarnings
815
956
  class PdfRenderWithWarnings
816
957
  attr_reader :output, :warnings
@@ -897,6 +1038,30 @@ end
897
1038
 
898
1039
 
899
1040
 
1041
+ def self.convert_chordpro_to_irealb(input)
1042
+ input = Chordsketch::uniffi_utf8(input)
1043
+
1044
+
1045
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_convert_chordpro_to_irealb,RustBuffer.allocFromString(input))
1046
+ return result.consumeIntoTypeConversionWithWarnings
1047
+ end
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+ def self.convert_irealb_to_chordpro_text(input)
1054
+ input = Chordsketch::uniffi_utf8(input)
1055
+
1056
+
1057
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_convert_irealb_to_chordpro_text,RustBuffer.allocFromString(input))
1058
+ return result.consumeIntoTypeConversionWithWarnings
1059
+ end
1060
+
1061
+
1062
+
1063
+
1064
+
900
1065
  def self.parse_and_render_html(input, config_json, transpose)
901
1066
  input = Chordsketch::uniffi_utf8(input)
902
1067
 
@@ -915,6 +1080,42 @@ end
915
1080
 
916
1081
 
917
1082
 
1083
+ def self.parse_and_render_html_body(input, config_json, transpose)
1084
+ input = Chordsketch::uniffi_utf8(input)
1085
+
1086
+
1087
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1088
+ RustBuffer.check_lower_Optionalstring(config_json)
1089
+
1090
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1091
+ RustBuffer.check_lower_Optionali8(transpose)
1092
+
1093
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1094
+ return result.consumeIntoString
1095
+ end
1096
+
1097
+
1098
+
1099
+
1100
+
1101
+ def self.parse_and_render_html_body_with_warnings(input, config_json, transpose)
1102
+ input = Chordsketch::uniffi_utf8(input)
1103
+
1104
+
1105
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1106
+ RustBuffer.check_lower_Optionalstring(config_json)
1107
+
1108
+ transpose = (transpose ? Chordsketch::uniffi_in_range(transpose, "i8", -2**7, 2**7) : nil)
1109
+ RustBuffer.check_lower_Optionali8(transpose)
1110
+
1111
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_and_render_html_body_with_warnings,RustBuffer.allocFromString(input),RustBuffer.alloc_from_Optionalstring(config_json),RustBuffer.alloc_from_Optionali8(transpose))
1112
+ return result.consumeIntoTypeTextRenderWithWarnings
1113
+ end
1114
+
1115
+
1116
+
1117
+
1118
+
918
1119
  def self.parse_and_render_html_with_warnings(input, config_json, transpose)
919
1120
  input = Chordsketch::uniffi_utf8(input)
920
1121
 
@@ -1005,6 +1206,87 @@ end
1005
1206
 
1006
1207
 
1007
1208
 
1209
+ def self.parse_irealb(input)
1210
+ input = Chordsketch::uniffi_utf8(input)
1211
+
1212
+
1213
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_parse_irealb,RustBuffer.allocFromString(input))
1214
+ return result.consumeIntoString
1215
+ end
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+ def self.render_html_css()
1222
+ result = Chordsketch.rust_call(:uniffi_chordsketch_ffi_fn_func_render_html_css,)
1223
+ return result.consumeIntoString
1224
+ end
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+ def self.render_html_css_with_config_json(config_json)
1231
+ config_json = (config_json ? Chordsketch::uniffi_utf8(config_json) : nil)
1232
+ RustBuffer.check_lower_Optionalstring(config_json)
1233
+
1234
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_html_css_with_config_json,RustBuffer.alloc_from_Optionalstring(config_json))
1235
+ return result.consumeIntoString
1236
+ end
1237
+
1238
+
1239
+
1240
+
1241
+
1242
+ def self.render_ireal_pdf(input)
1243
+ input = Chordsketch::uniffi_utf8(input)
1244
+
1245
+
1246
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_ireal_pdf,RustBuffer.allocFromString(input))
1247
+ return result.consumeIntoBytes
1248
+ end
1249
+
1250
+
1251
+
1252
+
1253
+
1254
+ def self.render_ireal_png(input)
1255
+ input = Chordsketch::uniffi_utf8(input)
1256
+
1257
+
1258
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_ireal_png,RustBuffer.allocFromString(input))
1259
+ return result.consumeIntoBytes
1260
+ end
1261
+
1262
+
1263
+
1264
+
1265
+
1266
+ def self.render_ireal_svg(input)
1267
+ input = Chordsketch::uniffi_utf8(input)
1268
+
1269
+
1270
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_render_ireal_svg,RustBuffer.allocFromString(input))
1271
+ return result.consumeIntoString
1272
+ end
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+ def self.serialize_irealb(input)
1279
+ input = Chordsketch::uniffi_utf8(input)
1280
+
1281
+
1282
+ result = Chordsketch.rust_call_with_error(ChordSketchError,:uniffi_chordsketch_ffi_fn_func_serialize_irealb,RustBuffer.allocFromString(input))
1283
+ return result.consumeIntoString
1284
+ end
1285
+
1286
+
1287
+
1288
+
1289
+
1008
1290
  def self.validate(input)
1009
1291
  input = Chordsketch::uniffi_utf8(input)
1010
1292
 
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chordsketch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - koedame
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-24 00:00:00.000000000 Z
11
+ date: 2026-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi