<commit_before>/*
 * Copyright(c) Sophist Solutions, Inc. 1990-2012.  All rights reserved
 */
#include    "../../../Foundation/StroikaPreComp.h"

#include    <cctype>
#include    <cstdio>    // for sprintf()

#include    "../../../Foundation/Characters/CodePage.h"
#include    "../../../Foundation/Characters/StringUtils.h"

#include    "../Config.h"

#if     qSilenceAnnoyingCompilerWarnings && _MSC_VER
#pragma warning (4 : 4786)      //qQuiteAnnoyingDebugSymbolTruncationWarnings
#endif

#include    "../StyledTextEmbeddedObjects.h"

#include    "StyledTextIO_HTML.h"





using   namespace   Stroika::Foundation;
using   namespace   Stroika::Foundation::Characters;

using   namespace   Stroika::Frameworks;
using   namespace   Stroika::Frameworks::Led;
using   namespace   Stroika::Frameworks::Led::StyledTextIO;






namespace {


    bool    ParseStringToInt_ (const string& s, int* t)
    {
        int l   =   0;
        if (::sscanf (s.c_str (), "%d", &l) < 1) {
            return false;
        }
        else {
            *t = l;
            return true;
        }
    }

    inline  bool    IsASCIISpace (Led_tChar c)
    {
        return isascii (c) and isspace (c);
    }



#if     qStaticInitializerOfPairOfStringStringInternalCompilerBug
    static  vector<pair<string, string> >    _mk_Color_Name_Table ()
    {
        static  pair<string, string> kColorNameTable [] = {
            pair<string, string> ("black",   "000000"),
            pair<string, string> ("silver",  "C0C0C0"),
            pair<string, string> ("gray",    "808080"),
            pair<string, string> ("white",   "FFFFFF"),
            pair<string, string> ("maroon",  "800000"),
            pair<string, string> ("red",     "FF0000"),
            pair<string, string> ("purple",  "800080"),
            pair<string, string> ("fuchsia", "FF00FF"),<commit_msg>rewrote ParseStringToInt_ () - using strtol  () in hopes of silencing VC11 warnings<commit_after>/*
 * Copyright(c) Sophist Solutions, Inc. 1990-2012.  All rights reserved
 */
#include    "../../../Foundation/StroikaPreComp.h"

#include    <cctype>
#include    <cstdio>    // for sprintf()

#include    "../../../Foundation/Characters/CodePage.h"
#include    "../../../Foundation/Characters/StringUtils.h"

#include    "../Config.h"

#if     qSilenceAnnoyingCompilerWarnings && _MSC_VER
#pragma warning (4 : 4786)      //qQuiteAnnoyingDebugSymbolTruncationWarnings
#endif

#include    "../StyledTextEmbeddedObjects.h"

#include    "StyledTextIO_HTML.h"





using   namespace   Stroika::Foundation;
using   namespace   Stroika::Foundation::Characters;

using   namespace   Stroika::Frameworks;
using   namespace   Stroika::Frameworks::Led;
using   namespace   Stroika::Frameworks::Led::StyledTextIO;






namespace {


    bool    ParseStringToInt_ (const string& s, int* t)
    {
        int		l   =   0;
		char*	e	=	nullptr;
		l = strtol (s.c_str (), &e, 10);
		if (s.c_str () == e) {
			return false;
		}
		else {
			*t = l;
			return true;
		}
    }

    inline  bool    IsASCIISpace (Led_tChar c)
    {
        return isascii (c) and isspace (c);
    }



#if     qStaticInitializerOfPairOfStringStringInternalCompilerBug
    static  vector<pair<string, string> >    _mk_Color_Name_Table ()
    {
        static  pair<string, string> kColorNameTable [] = {
            pair<string, string> ("black",   "000000"),
            pair<string, string> ("silver",  "C0C0C0"),
            pair<string, string> ("gray",    "808080"),
            pair<string, string> ("white",   "FFFFFF"),
            pair<string, string> ("maroon",  "800000"),
            pair<string, string> ("red",     "FF0000"),
            pair<string, string> ("purple",  "800080"),
            pair<string, string> ("fuchsia", "FF00FF"),
{'fraction_non_alphanumeric': 0.14433811802232854, 'fraction_numerical': 0.02631578947368421, 'mean_word_length': 2.5433145009416194, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 29, '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': '7662001', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1229, 'n_words': 269}