<commit_before>/*
 This file is part of "libarchive-ruby-swig", a simple SWIG wrapper around
 libarchive.

 Copyright 2011, <NAME> <<EMAIL>>
 
 libarchive-ruby-swig is licensed under a simplified BSD License. A copy of the
 license text can be found in the file LICENSE.txt distributed with the source.
*/

#ifndef CLASS_ARCHIVE_READER_H_INCLUDED
#define CLASS_ARCHIVE_READER_H_INCLUDED

struct archive;
class Entry;

#ifndef SWIG
#include <ruby.h>
#endif

class Reader
{
    public:
        Reader(struct archive *ar);
        virtual ~Reader();

        #ifdef SWIG
        %feature("autodoc", "Releases all resources associated with the Reader object") close;
        #endif
        void close();

#ifdef SWIG
%exception {
    try {
        $action
    } catch(Error &err) {
        static VALUE c_archive = rb_define_module("Archive");
        static VALUE e_archive =
            rb_define_class_under(c_archive, "Error", rb_eStandardError);
        rb_raise(e_archive, err.what());
    }
}
#endif

#ifdef SWIG
%feature("autodoc", "Use <code>Archive::read_open_filename</code> instead") read_open_filename;
%newobject read_open_filename(const char *filename, const char *cmd);
%feature("autodoc", "Use <code>Archive::read_open_memory</code> instead") read_open_memory;
%newobject read_open_memory(const char *string, int length, const char *cmd);
%feature("autodoc", "Returns the next Entry meta data object in the Archive") next_header;
%newobject next_header();
#endif

        static Reader *read_open_filename(const char *filename,
            const char *cmd = 0);
        static Reader *read_open_memory(const char *string, int length,
            const char *cmd = 0);

        Entry *next_header();
        VALUE read_data_helper(int len);

#ifdef SWIG
%exception;
#endif

    private:
        struct archive *_ar;
        char *_buf;
        char *_archive_content;
        int _buf_size;
};

#endif<commit_msg>reader.h: put class members in initialization order<commit_after>/*
 This file is part of "libarchive-ruby-swig", a simple SWIG wrapper around
 libarchive.

 Copyright 2011, <NAME> <<EMAIL>>
 
 libarchive-ruby-swig is licensed under a simplified BSD License. A copy of the
 license text can be found in the file LICENSE.txt distributed with the source.
*/

#ifndef CLASS_ARCHIVE_READER_H_INCLUDED
#define CLASS_ARCHIVE_READER_H_INCLUDED

struct archive;
class Entry;

#ifndef SWIG
#include <ruby.h>
#endif

class Reader
{
    public:
        Reader(struct archive *ar);
        virtual ~Reader();

        #ifdef SWIG
        %feature("autodoc", "Releases all resources associated with the Reader object") close;
        #endif
        void close();

#ifdef SWIG
%exception {
    try {
        $action
    } catch(Error &err) {
        static VALUE c_archive = rb_define_module("Archive");
        static VALUE e_archive =
            rb_define_class_under(c_archive, "Error", rb_eStandardError);
        rb_raise(e_archive, err.what());
    }
}
#endif

#ifdef SWIG
%feature("autodoc", "Use <code>Archive::read_open_filename</code> instead") read_open_filename;
%newobject read_open_filename(const char *filename, const char *cmd);
%feature("autodoc", "Use <code>Archive::read_open_memory</code> instead") read_open_memory;
%newobject read_open_memory(const char *string, int length, const char *cmd);
%feature("autodoc", "Returns the next Entry meta data object in the Archive") next_header;
%newobject next_header();
#endif

        static Reader *read_open_filename(const char *filename,
            const char *cmd = 0);
        static Reader *read_open_memory(const char *string, int length,
            const char *cmd = 0);

        Entry *next_header();
        VALUE read_data_helper(int len);

#ifdef SWIG
%exception;
#endif

    private:
        struct archive *_ar;
        char *_buf;
        int _buf_size;
        char *_archive_content;
};

#endif
{'fraction_non_alphanumeric': 0.10030864197530864, 'fraction_numerical': 0.0030864197530864196, 'mean_word_length': 3.511600928074246, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3202034', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1165, 'n_words': 367}