<commit_before>/*
 * $Id: field.cc,v 2.7 2005/10/20 11:24:12 martin Exp $
 * Copyright (c) 2004, 2005, Voidsoft AB
 */

#include <iostream>
#include "field.hh"
#include "tdspp.hh" // for TDSPP::Exception

/** Class Field */
/** Constructor */
Field::Field()
    : data(NULL) {
}

Field::Field(string name, int size) {
    colname = name;
    data = new char[size] = {0};
}

/** Destructor */
Field::~Field() {
    delete [] data; 
}

string Field::tostr() {
    if (!data) throw TDSPP::Exception("Field::tostr: Data not initialized");
    return data;
}

/* Not implemented */
long Field::toint() {
    if (!data) throw TDSPP::Exception("Field::toint: Data not initialized");
    return 0;
}

/** Class Rows */
/** Constructor */
Rows::Rows()
    : currentrow(0) {
}

/** Destructor */
Rows::~Rows() {
    clear();
}
<commit_msg>More portable initialitation mode Extended initializer lists only available with -std=c++0x or -std=gnu++0x<commit_after>/*
 * $Id: field.cc,v 2.7 2005/10/20 11:24:12 martin Exp $
 * Copyright (c) 2004, 2005, Voidsoft AB
 */

#include <iostream>
#include "field.hh"
#include "tdspp.hh" // for TDSPP::Exception

/** Class Field */
/** Constructor */
Field::Field()
    : data(NULL) {
}

Field::Field(string name, int size) {
    colname = name;
    data = new char[size];
    data[0] = 0;
}

/** Destructor */
Field::~Field() {
    delete [] data; 
}

string Field::tostr() {
    if (!data) throw TDSPP::Exception("Field::tostr: Data not initialized");
    return data;
}

/* Not implemented */
long Field::toint() {
    if (!data) throw TDSPP::Exception("Field::toint: Data not initialized");
    return 0;
}

/** Class Rows */
/** Constructor */
Rows::Rows()
    : currentrow(0) {
}

/** Destructor */
Rows::~Rows() {
    clear();
}

{'fraction_non_alphanumeric': 0.19342030629608623, 'fraction_numerical': 0.03233125354509359, 'mean_word_length': 3.4545454545454546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6007385', 'n_tokens_mistral': 672, 'n_tokens_neox': 631, 'n_words': 159}