Go to file
Piotr Rogowski bea98d37fa
Resolve Defines
2023-12-29 16:01:02 +01:00
.github Bump zgosalvez/github-actions-analyze-dart from 2 to 3 (#6) 2023-12-08 09:01:44 +01:00
.vscode Turn on eagerError 2023-12-08 08:59:29 +01:00
example Update README with example 2023-12-08 09:08:40 +01:00
lib Resolve Defines 2023-12-29 16:01:02 +01:00
scripts Initial commit 2023-09-27 13:19:33 +02:00
test Resolve Defines 2023-12-29 16:01:02 +01:00
.gitignore Initial commit 2023-09-27 13:19:33 +02:00
.metadata Initial commit 2023-09-27 13:19:33 +02:00
LICENSE Initial commit 2023-09-27 13:19:33 +02:00
README.md Update README with example 2023-12-08 09:08:40 +01:00
analysis_options.yaml Initial commit 2023-09-27 13:19:33 +02:00
pubspec.yaml Initial commit 2023-09-27 13:19:33 +02:00

README.md

codecov

HyperTuner INI parser

INI parser for HyperTuner written in Dart.

Roadmap

Checkout Roadmap issue: https://github.com/hyper-tuner/ini_parser/issues/2

Example usage

from example/save_as_json.dart:

import 'dart:convert';
import 'dart:io';

import 'package:ini_parser/ini_parser.dart';
import 'package:path/path.dart' as p;

void main() async {
  final timer = Stopwatch()..start();
  const fileNames = [
    {
      'ecosystem': 'speeduino',
      'name': '202207',
    },
    {
      'ecosystem': 'fome',
      'name': 'fome_proteus_f4',
    },
  ];

  for (final fileName in fileNames) {
    final raw = File(
      p.join(
        Directory.current.path,
        'test/data/${fileName['ecosystem']}/ini/${fileName['name']}.ini',
      ),
    ).readAsStringSync();
    final config = await INIParser(raw).parse();
    final json = const JsonEncoder.withIndent('  ').convert(config);

    File(
      p.join(
        Directory.current.path,
        'test/data/${fileName['ecosystem']}/json/${fileName['name']}.json',
      ),
    ).writeAsStringSync(json);
  }

  // ignore: avoid_print
  print('Done in ${timer.elapsedMilliseconds}ms');
}

Compile and run:

dart compile exe example/save_as_json.dart

./example/save_as_json