<commit_before>// -------------------------------------------------------------------------
//    @FileName         :    NFCDataList.h
//    @Author           :    LvSheng.Huang
//    @Date             :    2012-03-01
//    @Module           :    NFCDataList
//
// -------------------------------------------------------------------------

#include <cstdarg>
#include "NFCDataList.h"
#include "NFIDataList.h"

NFCDataList::NFCDataList()
    : NFIDataList()
{
}

NFCDataList::NFCDataList(const std::string& str, const std::string& strSplit)
{
    Clear();

    Split(str, strSplit);
}

NFCDataList::NFCDataList(const NFCDataList& src)
{
    Clear();

    InnerAppendEx(src, 0, src.GetCount());
}

NFCDataList::NFCDataList(const NFIDataList& src)
{
    Clear();

    InnerAppendEx(src, 0, src.GetCount());
}

NFCDataList::~NFCDataList()
{
    Clear();
};

/*
NFCDataList& NFCDataList::operator=(const NFCDataList& src)
{
    Clear();
    InnerAppendEx(src, 0, src.GetCount());

    return *this;
}

NFCDataList& NFCDataList::operator=(const NFIDataList& src)
{
    Clear();
    InnerAppendEx(src, 0, src.GetCount());

    return *this;
}

*/

bool NFCDataList::Append(const NFIDataList& src, const int start, const int count)
{
    if (start >= src.GetCount())
    {
        return false;
    }

    int end = start + count;

    if (end > src.GetCount())
    {
        return false;
    }

    InnerAppendEx(src, start, end);

    return true;
}

bool NFCDataList::Append(const NFIDataList::TData& xData)
{
    if (xData.GetType() <= TDATA_UNKNOWN
        || xData.GetType() >= TDATA_MAX)
    {
        return false;
    }

    switch (xData.GetType())
    {
        case TDATA_INT:
            AddInt(xData.GetInt());
            break;
        case TDATA_FLOAT:
            AddFloat(xData.GetFloat());
            break;
        case TDATA_OBJECT:
            AddObject(xData.GetObject());
            break;
        case TDATA_STRING:
            AddString(xData.GetString());
            break;
		case TDATA_VECTOR2:
			AddVector2(xData.GetVector2());
		case TDATA_VECTOR3:
			AddVector3(xData.GetVector3());
			break;
			break;
        default:
            break;
    }

    return true;
}

bool NFCDataList::Append(const NFIDataList& src)
{
    return Append(src, 0, src.GetCount());
}

bool NFCDataList::Add(const NFINT64 value)
{
    if (GetCount() == mvList.size())<commit_msg>fixed NFCDataList.cpp<commit_after>// -------------------------------------------------------------------------
//    @FileName         :    NFCDataList.h
//    @Author           :    LvSheng.Huang
//    @Date             :    2012-03-01
//    @Module           :    NFCDataList
//
// -------------------------------------------------------------------------

#include <cstdarg>
#include "NFCDataList.h"
#include "NFIDataList.h"

NFCDataList::NFCDataList()
    : NFIDataList()
{
}

NFCDataList::NFCDataList(const std::string& str, const std::string& strSplit)
{
    Clear();

    Split(str, strSplit);
}

NFCDataList::NFCDataList(const NFCDataList& src)
{
    Clear();

    InnerAppendEx(src, 0, src.GetCount());
}

NFCDataList::NFCDataList(const NFIDataList& src)
{
    Clear();

    InnerAppendEx(src, 0, src.GetCount());
}

NFCDataList::~NFCDataList()
{
    Clear();
};

/*
NFCDataList& NFCDataList::operator=(const NFCDataList& src)
{
    Clear();
    InnerAppendEx(src, 0, src.GetCount());

    return *this;
}

NFCDataList& NFCDataList::operator=(const NFIDataList& src)
{
    Clear();
    InnerAppendEx(src, 0, src.GetCount());

    return *this;
}

*/

bool NFCDataList::Append(const NFIDataList& src, const int start, const int count)
{
    if (start >= src.GetCount())
    {
        return false;
    }

    int end = start + count;

    if (end > src.GetCount())
    {
        return false;
    }

    InnerAppendEx(src, start, end);

    return true;
}

bool NFCDataList::Append(const NFIDataList::TData& xData)
{
    if (xData.GetType() <= TDATA_UNKNOWN
        || xData.GetType() >= TDATA_MAX)
    {
        return false;
    }

    switch (xData.GetType())
    {
        case TDATA_INT:
            AddInt(xData.GetInt());
            break;
        case TDATA_FLOAT:
            AddFloat(xData.GetFloat());
            break;
        case TDATA_OBJECT:
            AddObject(xData.GetObject());
            break;
        case TDATA_STRING:
            AddString(xData.GetString());
            break;
		case TDATA_VECTOR2:
			AddVector2(xData.GetVector2());
			break;
		case TDATA_VECTOR3:
			AddVector3(xData.GetVector3());
			break;
        default:
            break;
    }

    return true;
}

bool NFCDataList::Append(const NFIDataList& src)
{
    return Append(src, 0, src.GetCount());
}

bool NFCDataList::Add(const NFINT64 value)
{
    if (GetCount() == mvList.size())
{'fraction_non_alphanumeric': 0.1927584763499372, 'fraction_numerical': 0.008790288823775638, 'mean_word_length': 2.0, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '2619008', 'n_tokens_mistral': 1679, 'n_tokens_neox': 1581, 'n_words': 294}