feisty meow concerns codebase  2.140
nechung_oracle Class Reference

#include <nechung_oracle.h>

Public Member Functions

 nechung_oracle (const basis::astring &data_filename, const basis::astring &index_filename)
 
virtual ~nechung_oracle ()
 
 DEFINE_CLASS_NAME ("nechung_oracle")
 
basis::astring pick_random ()
 
void display_random ()
 

Detailed Description

Definition at line 47 of file nechung_oracle.h.

Constructor & Destructor Documentation

◆ nechung_oracle()

nechung_oracle::nechung_oracle ( const basis::astring data_filename,
const basis::astring index_filename 
)

Definition at line 37 of file nechung_oracle.cpp.

◆ ~nechung_oracle()

nechung_oracle::~nechung_oracle ( )
virtual

Definition at line 45 of file nechung_oracle.cpp.

Member Function Documentation

◆ DEFINE_CLASS_NAME()

nechung_oracle::DEFINE_CLASS_NAME ( "nechung_oracle"  )

◆ display_random()

void nechung_oracle::display_random ( )

Definition at line 252 of file nechung_oracle.cpp.

References basis::astring::end(), is_eol(), LOG, pick_random(), and basis::astring::zap().

Referenced by main().

◆ pick_random()

astring nechung_oracle::pick_random ( )

printf("num forts = %d\n", c_number_of_fortunes );

printf("rand chose= %d\n", to_display);

hmmm: this bit could be more efficient by just jumping to the Nth line instead of reading through up to the Nth line.

Definition at line 177 of file nechung_oracle.cpp.

References basis::array< contents >::access(), filesystem::byte_filer::close(), filesystem::byte_filer::eof(), FUNCDEF, filesystem::byte_filer::getline(), filesystem::byte_filer::good(), mathematics::chaos::inclusive(), LOG, MAX_LINE_LENGTH, NECHUNG_SEPARATION_CHARACTER, non_continuable_error, basis::astring::observe(), basis::astring::s(), and filesystem::byte_filer::seek().

Referenced by display_random(), and main().


The documentation for this class was generated from the following files: