general/import.cc File Reference

#include <unistd.h>
#include <iostream>
#include "log.h"
#include "channel.h"
#include "import.h"
#include "general.h"
#include "util.h"

Defines

#define DEBUG_ROUTINE   "import"

Functions

void set_file (string file)
 open a new file for reading
void next ()
 get the next character from the file
bool firstpair (channel *ch)
void keypair (channel *ch)
bool import_next (channel *ch)
 find the next key-value pair in the file

Variables

static char c = 0
 the current character of the file
static bool descr = false
 set when this line seems to be a description
static bool newl = true
 set when the current character is directly after a new line, a start of a new file is also a new line
static bool val = false
 set when reading a value
static bool key = false
 set when reading a key
static string cur = ""
 keeps the current start of the line primarily for getting the record name from a line when it was still unknown if it could be a record line
static FILE * fp = NULL
 current file pointer of the file to read
static bool record = false
 set when the current line appears to be a record line
static string crec = ""
list< pair< string,
string > > 
todo
string records [] = {"rule", "chapter", "category", "job", "background", "explain", "deity", "action", "skill", "special", "guild", "creature", "unit", "item", "race", "guild", "culture", "unit", "aging"}
 list of possible record names

Define Documentation

#define DEBUG_ROUTINE   "import"


Function Documentation

bool firstpair ( channel ch  ) 

bool import_next ( channel ch  ) 

find the next key-value pair in the file

void keypair ( channel ch  ) 

void next (  ) 

get the next character from the file

void set_file ( string  file  ) 

open a new file for reading


Variable Documentation

char c = 0 [static]

the current character of the file

string crec = "" [static]

string cur = "" [static]

keeps the current start of the line primarily for getting the record name from a line when it was still unknown if it could be a record line

bool descr = false [static]

set when this line seems to be a description

FILE* fp = NULL [static]

current file pointer of the file to read

bool key = false [static]

set when reading a key

bool newl = true [static]

set when the current character is directly after a new line, a start of a new file is also a new line

bool record = false [static]

set when the current line appears to be a record line

string records[] = {"rule", "chapter", "category", "job", "background", "explain", "deity", "action", "skill", "special", "guild", "creature", "unit", "item", "race", "guild", "culture", "unit", "aging"}

list of possible record names

list<pair<string,string> > todo

bool val = false [static]

set when reading a value



Generated on Tue Jan 1 17:30:01 2008 for general/import.cc File Reference by  doxygen   Visit the project page on SourceForge.net Logo