<commit_before>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2013 <NAME> (gsomix)
 */

#ifdef HAVE_PROTOBUF

#ifndef __PROTOBUFFILE_H__
#define __PROTOBUFFILE_H__

#include <shogun/lib/config.h>

#include <shogun/io/File.h>

#if defined(__APPLE__) && defined(TYPE_BOOL)
    #define ___APPLE_TYPE_BOOL TYPE_BOOL
    #undef TYPE_BOOL
#endif

#include <google/protobuf/message.h>

#if defined(__APPLE__) && defined(___APPLE_TYPE_BOOL)
    #define TYPE_BOOL ___APPLE_TYPE_BOOL
    #undef ___APPLE_TYPE_BOOL
#endif

#include <shogun/io/protobuf/ShogunVersion.pb.h>
#include <shogun/io/protobuf/Headers.pb.h>
#include <shogun/io/protobuf/Chunks.pb.h>

namespace shogun
{

/** @brief Class for work with binary file
 * in protobuf format.
 *
 * Format of serialized data in byte file:
 * <pre>
 * size of ShogunVersion message - big endian uint32
 * ShogunVersion message
 * size of next message - big endian uint32
 * data message, e.g. Int32Chunk
 * ...
 * </pre>
 */
class CProtobufFile : public CFile
{
public:
	/** default constructor */<commit_msg>Fixed macosx ifdef in ProtobufFile<commit_after>/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Written (W) 2013 <NAME> (gsomix)
 */

#ifdef HAVE_PROTOBUF

#ifndef __PROTOBUFFILE_H__
#define __PROTOBUFFILE_H__

#include <shogun/lib/config.h>

#include <shogun/io/File.h>

// a hack to avoid clashes with apple's ConditionalMacros.h
#ifdef __APPLE__
    #ifdef TYPE_BOOL
        #define ___APPLE_TYPE_BOOL TYPE_BOOL
        #undef TYPE_BOOL
    #endif
#endif

#include <google/protobuf/message.h>

#ifdef __APPLE__
    #ifdef ___APPLE_TYPE_BOOL
        #define TYPE_BOOL ___APPLE_TYPE_BOOL
        #undef ___APPLE_TYPE_BOOL
    #endif
#endif

#include <shogun/io/protobuf/ShogunVersion.pb.h>
#include <shogun/io/protobuf/Headers.pb.h>
#include <shogun/io/protobuf/Chunks.pb.h>

namespace shogun
{

/** @brief Class for work with binary file
 * in protobuf format.
 *
 * Format of serialized data in byte file:
 * <pre>
 * size of ShogunVersion message - big endian uint32
 * ShogunVersion message
 * size of next message - big endian uint32
 * data message, e.g. Int32Chunk
 * ...
 * </pre>
 */
class CProtobufFile : public CFile
{
public:
	/** default constructor */
{'fraction_non_alphanumeric': 0.09724839803995476, 'fraction_numerical': 0.008292499057670561, 'mean_word_length': 3.9057301293900184, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3839760', 'n_tokens_mistral': 905, 'n_tokens_neox': 883, 'n_words': 278}