<commit_before>package luxe;

import luxe.Core;

@:allow(luxe.Core)
class IO {

    public var core : Core;

    function new( _core:Core ) {
        core = _core;
    } //new

//Path specifics
#if luxe_native
    public var app_path (get,never) : String;
    public var app_path_prefs (get,never) : String;
#end

//Utility features

        /** Open the system default browser with the given URL.
            supported: mac/window/linux/iOS/web
            pending: android https://github.com/underscorediscovery/snow/issues/25 */
    public function url_open( _url:String ) {

        core.app.io.url_open( _url );

    } //url_open

//Internal

#if luxe_native

    function get_app_path() {

        return core.app.io.module.app_path();

    } //get_app_path

    function get_app_path_prefs() {

        return core.app.io.module.app_path_prefs();

    } //get_app_path

#end

    function init() {
<commit_msg>io; string sync; add string_save and string_load api (see snow commit log)<commit_after>package luxe;

import luxe.Core;

@:allow(luxe.Core)
class IO {

    public var core : Core;

    function new( _core:Core ) {
        core = _core;
    } //new

//Path specifics
#if luxe_native
    public var app_path (get,never) : String;
    public var app_path_prefs (get,never) : String;
#end

//Utility features

        /** Open the system default browser with the given URL.
            supported: mac/window/linux/iOS/web
            pending: android https://github.com/underscorediscovery/snow/issues/25 */
    public inline function url_open( _url:String ) {

        core.app.io.url_open( _url );

    } //url_open

        /** Save a string value by key, with an optional slot.
            Works on all targets as a simple save/load mechanism.
            Data saved is plain text but obscured with basic encoding.
            Any further obfuscation can be done on the value prior to saving.
            Returns false if the save failed, errors being logged. */
    public inline function string_save( _key:String, _value:String, _slot:Int = 0 ) : Bool {

        return core.app.io.string_save(_key, _value, _slot);

    } //string_save

        /** Load a string value by key, with an optional slot.
            Works on all targets as a simple save/load mechanism.
            Returns the string or null if the key was invalid, or the slot was not found. */
    public inline function string_load( _key:String, _slot:Int = 0 ) : String {

        return core.app.io.string_load(_key, _slot);

    } //string_load

//Internal

#if luxe_native

    function get_app_path() {

        return core.app.io.module.app_path();

    } //get_app_path

    function get_app_path_prefs() {

        return core.app.io.module.app_path_prefs();

    } //get_app_path

#end

    function init() {

{'fraction_non_alphanumeric': 0.09875222816399287, 'fraction_numerical': 0.0021390374331550803, 'mean_word_length': 2.455665024630542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6830052', 'n_tokens_mistral': 897, 'n_tokens_neox': 855, 'n_words': 265}