<commit_before>#pragma once

#include "../../type.hxx"
#include "type.hxx"
#include "../stream/load.hxx"

#include <boost/optional.hpp>

#include <fstream>

namespace usagi::json::picojson::io::filesystem
{
  static inline auto load( const path_type& filesystem_path )
    -> value_type
  {
    std::ifstream f;
    f.exceptions( std::ifstream::failbit | std::ifstream::badbit );
    f.open( filesystem_path.string() );
    
    return load( std::istreambuf_iterator< char >( f ) );
  }
  
  static inline auto load_optional( const filesystem_path& in )
    -> boost::optional< value_type >
  { 
    try
    { return load( in ); }
    catch ( ... )
    { return { }; }
  }
}<commit_msg>fixup<commit_after>#pragma once

#include "../../type.hxx"
#include "type.hxx"
#include "../stream/load.hxx"

#include <boost/optional.hpp>

#include <fstream>

namespace usagi::json::picojson::io::filesystem
{
  static inline auto load( const path_type& filesystem_path )
    -> value_type
  {
    std::ifstream f;
    f.exceptions( std::ifstream::failbit | std::ifstream::badbit );
    f.open( filesystem_path.string() );
    
    return steam::load( std::istreambuf_iterator< char >( f ) );
  }
  
  static inline auto load_optional( const filesystem_path& in )
    -> boost::optional< value_type >
  { 
    try
    { return load( in ); }
    catch ( ... )
    { return { }; }
  }
}
{'fraction_non_alphanumeric': 0.16046681254558717, 'fraction_numerical': 0.0, 'mean_word_length': 3.1957186544342506, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '4733942', 'n_tokens_mistral': 478, 'n_tokens_neox': 472, 'n_words': 98}