<commit_before>/**
 * Copyright (c) 2015, <NAME>, Quintelligence d.o.o. and contributors
 * All rights reserved.
 * 
 * This source code is licensed under the FreeBSD license found in the
 * LICENSE file in the root directory of this source tree.
 */

/////////////////////////////////////////////////
// Blob-Pointer
const int TBlobPt::Flags=24;

void TBlobPt::PutFlag(const int& FlagN, const bool& Val){
  EAssert((0<=FlagN)&&(FlagN<Flags));
  switch (FlagN/8){
    case 0: FSet1.SetBit(7-FlagN%8, Val); break;
    case 1: FSet2.SetBit(7-FlagN%8, Val); break;
    case 2: FSet3.SetBit(7-FlagN%8, Val); break;
    default: Fail;
  }
}

bool TBlobPt::IsFlag(const int& FlagN) const {
  EAssert((0<=FlagN)&&(FlagN<Flags));
  switch (FlagN/8){
    case 0: return FSet1.GetBit(7-FlagN%8);
    case 1: return FSet2.GetBit(7-FlagN%8);
    case 2: return FSet3.GetBit(7-FlagN%8);
    default: Fail; return false;
  }
}

void TBlobPt::PutFSet(const int& FSetN, const TB8Set& FSet){
  switch (FSetN){
    case 1: FSet1=FSet; break;
    case 2: FSet2=FSet; break;
    case 3: FSet3=FSet; break;
    default: Fail;
  }
}

TB8Set TBlobPt::GetFSet(const int& FSetN){
  switch (FSetN){
    case 1: return FSet1;
    case 2: return FSet2;
    case 3: return FSet3;
    default: Fail; return TB8Set();
  }
}

TStr TBlobPt::GetStr() const {
  TChA ChA;
  ChA+='[';
  if (Empty()){
    ChA+="Null";
  } else {
    ChA+=TUInt::GetStr(uint(Seg)); ChA+=':'; ChA+=TUInt::GetStr(Addr);
    for (int FlagN=0; FlagN<Flags; FlagN++){
      if (IsFlag(FlagN)){
        ChA+='{'; ChA+=TInt::GetStr(FlagN); ChA+='}';}
    }
  }
  ChA+=']';
  return ChA;
}

/////////////////////////////////////////////////
// Blob-Base
const int TBlobBs::MnBlobBfL=16;
const int TBlobBs::MxBlobFLen=1000000000;

void TBlobBs::PutVersionStr(const PFRnd& FBlobBs){
  FBlobBs->PutStr(GetVersionStr());
}

void TBlobBs::AssertVersionStr(const PFRnd& FBlobBs){<commit_msg>Increased blob file size limit from 1GB to 2GB<commit_after>/**
 * Copyright (c) 2015, <NAME>, Quintelligence d.o.o. and contributors
 * All rights reserved.
 * 
 * This source code is licensed under the FreeBSD license found in the
 * LICENSE file in the root directory of this source tree.
 */

/////////////////////////////////////////////////
// Blob-Pointer
const int TBlobPt::Flags=24;

void TBlobPt::PutFlag(const int& FlagN, const bool& Val){
  EAssert((0<=FlagN)&&(FlagN<Flags));
  switch (FlagN/8){
    case 0: FSet1.SetBit(7-FlagN%8, Val); break;
    case 1: FSet2.SetBit(7-FlagN%8, Val); break;
    case 2: FSet3.SetBit(7-FlagN%8, Val); break;
    default: Fail;
  }
}

bool TBlobPt::IsFlag(const int& FlagN) const {
  EAssert((0<=FlagN)&&(FlagN<Flags));
  switch (FlagN/8){
    case 0: return FSet1.GetBit(7-FlagN%8);
    case 1: return FSet2.GetBit(7-FlagN%8);
    case 2: return FSet3.GetBit(7-FlagN%8);
    default: Fail; return false;
  }
}

void TBlobPt::PutFSet(const int& FSetN, const TB8Set& FSet){
  switch (FSetN){
    case 1: FSet1=FSet; break;
    case 2: FSet2=FSet; break;
    case 3: FSet3=FSet; break;
    default: Fail;
  }
}

TB8Set TBlobPt::GetFSet(const int& FSetN){
  switch (FSetN){
    case 1: return FSet1;
    case 2: return FSet2;
    case 3: return FSet3;
    default: Fail; return TB8Set();
  }
}

TStr TBlobPt::GetStr() const {
  TChA ChA;
  ChA+='[';
  if (Empty()){
    ChA+="Null";
  } else {
    ChA+=TUInt::GetStr(uint(Seg)); ChA+=':'; ChA+=TUInt::GetStr(Addr);
    for (int FlagN=0; FlagN<Flags; FlagN++){
      if (IsFlag(FlagN)){
        ChA+='{'; ChA+=TInt::GetStr(FlagN); ChA+='}';}
    }
  }
  ChA+=']';
  return ChA;
}

/////////////////////////////////////////////////
// Blob-Base
const int TBlobBs::MnBlobBfL=16;
const int TBlobBs::MxBlobFLen=2000000000;

void TBlobBs::PutVersionStr(const PFRnd& FBlobBs){
  FBlobBs->PutStr(GetVersionStr());
}

void TBlobBs::AssertVersionStr(const PFRnd& FBlobBs){
{'fraction_non_alphanumeric': 0.20726991492652747, 'fraction_numerical': 0.03248259860788863, 'mean_word_length': 3.06282722513089, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6685362', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1513, 'n_words': 359}