<commit_before>/** \file lispio.h
 * definitions of pure input output classes.
 */


#ifndef YACAS_LISPIO_H
#define YACAS_LISPIO_H

#include <cstddef>
#include <string>

#include "lisptype.h"

class InputStatus
{
public:
  InputStatus() : iFileName("none") , iLineNumber(-1)  {}

  void SetTo(const std::string& aFileName);
  void RestoreFrom(InputStatus& aPreviousStatus);
  int LineNumber();
  const std::string& FileName();
  void NextLine();

  inline InputStatus(const InputStatus& aOther) : iFileName(aOther.iFileName) , iLineNumber(aOther.iLineNumber)
  {
  }

  inline InputStatus& operator=(const InputStatus& aOther)
  {
    iFileName   = aOther.iFileName;
    iLineNumber = aOther.iLineNumber;
    return *this;
  }

private:
  std::string iFileName;
  int  iLineNumber;
};

inline
int InputStatus::LineNumber()
{
  return iLineNumber;
}

inline
const std::string& InputStatus::FileName()
{
  return iFileName;
}

inline
void InputStatus::NextLine()
{
  iLineNumber++;
}

/** \class LispInput : pure abstract class declaring the interface
 *  that needs to be implemented by a file (something that expressions
 *  can be read from).<commit_msg>minor cleanup<commit_after>/** \file lispio.h
 * definitions of pure input output classes.
 */


#ifndef YACAS_LISPIO_H
#define YACAS_LISPIO_H

#include <cstddef>
#include <string>

#include "lisptype.h"

class InputStatus
{
public:
  InputStatus() : iFileName("none") , iLineNumber(-1)  {}

  void SetTo(const std::string& aFileName);
  void RestoreFrom(InputStatus& aPreviousStatus);
  int LineNumber();
  const std::string& FileName();
  void NextLine();

private:
  std::string iFileName;
  int  iLineNumber;
};

inline
int InputStatus::LineNumber()
{
  return iLineNumber;
}

inline
const std::string& InputStatus::FileName()
{
  return iFileName;
}

inline
void InputStatus::NextLine()
{
  iLineNumber++;
}

/** \class LispInput : pure abstract class declaring the interface
 *  that needs to be implemented by a file (something that expressions
 *  can be read from).
{'fraction_non_alphanumeric': 0.11631345490389354, 'fraction_numerical': 0.0009857072449482504, 'mean_word_length': 4.686274509803922, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5885149', 'n_tokens_mistral': 676, 'n_tokens_neox': 664, 'n_words': 181}