Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CDataStructures.cpp File Reference


Functions

string itos (int i)
string ltos (long l)
int stoi (string s)
long stol (string s)
string breakString (string &incoming, string delim)
 Breaks the first field off a string delimited by delim and returns it. More...

int comparePeople (CPerson *a, CPerson *b, bool lastthenfirst)
 For sorting two people lexicographically by their names in either first, laast name, or vice-versa, as in accordance with functional spec. More...

int compareMp3Tracks (CMp3Track *a, CMp3Track *b, bool titlethenartist)
 For sorting lexicographically two CMp3Track's by their title and artist, in either order as specified by the boolean argument. More...

int compareTime (int hour1, int min1, bool pm1, int hour2, int min2, bool pm2)
int compareTime (CDate *a, CDate *b)
 Compares two CDates taking into account all day events are before timed events as well sorting by ending times, and by the description of the event. More...

int compareDate (int day1, int month1, int year1, int day2, int month2, int year2)
int compareDate (CDate *a, CDate *b)
 Compares two dates of two CDates. More...

int compareCDate (CDate *a, CDate *b)
 Compares CDates a and b to see which happens first. More...

bool isLeapYear (int year)
 Calculates correctly whether a year is leap or not. More...

bool isValidDate (int day, int month, int year)
 Checks if date is valid. Must be between 2001 and 2299. More...

int calcDayOfWeek (int day, int month, int year)
 Calculates the actual day of a date between 2001 and 2299. More...

string calcDayOfWeekAsString (int day, int month, int year)
 Returns the day as a string. More...

string getNameOfMonth (int month, bool abbreviated=true)
 Returns the month as a string in either abbreviated format or full. More...


Function Documentation

string breakString string &    incoming,
string    delim
 

Breaks the first field off a string delimited by delim and returns it.

Parameters:
incoming  String to take field from, this will get modified (field and delimiter will be removed)
delim  Delimiter between fields
Returns:
The field (without delimiter) and the incoming string will be modified

int calcDayOfWeek int    day,
int    month,
int    year
 

Calculates the actual day of a date between 2001 and 2299.

-1 invalid date 0 Saturday 1 Sunday 2 Monday 3 Tuesday 4 Wednesday 5 Thursday 6 Friday

string calcDayOfWeekAsString int    day,
int    month,
int    year
 

Returns the day as a string.

For example "Monday" If the date is invalid, returns "";

int compareCDate CDate   a,
CDate   b
 

Compares CDates a and b to see which happens first.

Compares the date and the start times of each. Returns -1 if a starts before b Returns 0 if a and b happen at the same time Returns 1 if a starts after b

int compareDate CDate   a,
CDate   b
 

Compares two dates of two CDates.

Returns -1 is first date is earlier than second date Returns 0 if they are the same date Returns 1 if first date is later than second date

int compareDate int    day1,
int    month1,
int    year1,
int    day2,
int    month2,
int    year2
 

int compareMp3Tracks CMp3Track   a,
CMp3Track   b,
bool    titlethenartist
 

For sorting lexicographically two CMp3Track's by their title and artist, in either order as specified by the boolean argument.

int comparePeople CPerson   a,
CPerson   b,
bool    lastthenfirst
 

For sorting two people lexicographically by their names in either first, laast name, or vice-versa, as in accordance with functional spec.

int compareTime CDate   a,
CDate   b
 

Compares two CDates taking into account all day events are before timed events as well sorting by ending times, and by the description of the event.

int compareTime int    hour1,
int    min1,
bool    pm1,
int    hour2,
int    min2,
bool    pm2
 

string getNameOfMonth int    month,
bool    abbreviated = true
 

Returns the month as a string in either abbreviated format or full.

Returns "" if month is not in {1,2,...,12}

bool isLeapYear int    year
 

Calculates correctly whether a year is leap or not.

bool isValidDate int    day,
int    month,
int    year
 

Checks if date is valid. Must be between 2001 and 2299.

string itos int    i
 

string ltos long    l
 

int stoi string    s
 

long stol string    s
 


Generated on Thu Dec 6 00:14:49 2001 for Dijinni by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001