#include <skill-entry.hpp>
Inheritance diagram for skillEntry:
Each node has three values: a string representing the skill, an integer value for the level attained for that skill and a pointer to the next skill in the list.
using a class based skill implementation, implement cascading skills properly.
Definition at line 42 of file skill-entry.hpp.
Public Member Functions | |
skillEntry () | |
skillEntry (char *) | |
skillEntry (char *, int) | |
skillEntry * | getNext () |
void | setNext (skillEntry *) |
char * | getSkill () |
void | setSkill (char *) |
int | getLevel () |
void | setLevel (int) |
char * | toString () |
void | XMLout (FILE *fout) |
skillEntry::skillEntry | ( | ) |
skillEntry::skillEntry | ( | char * | ) |
Create a new skill entry named with the passed in string and assign it a level of 1.
(char*) | pointer to a string representing the skill being added. |
Definition at line 55 of file skill-entry.cpp.
00055 { 00056 00057 skill=(char*)malloc(strlen(s)+1); 00058 sprintf(skill,"%s",s); 00059 level=1; 00060 }
skillEntry::skillEntry | ( | char * | , | |
int | ||||
) |
Create a new skill entry with the name an level as passed.
(char*) | pointer to a string representing the skill being added. | |
int | -- integer value for the level to assign to that skill. |
Definition at line 62 of file skill-entry.cpp.
00062 { 00063 level = l; 00064 00065 skill = (char*) malloc(strlen(s)+1); 00066 sprintf(skill,"%s",s); 00067 }
int skillEntry::getLevel | ( | ) |
Return the skill level for this skill.
Definition at line 77 of file skill-entry.cpp.
Referenced by skillList::addSkill(), and skillList::listOfSkillString().
Here is the caller graph for this function:
skillEntry * skillEntry::getNext | ( | ) |
Retrieve the value of the pointer pointing to the next skill in the list.
Definition at line 69 of file skill-entry.cpp.
Referenced by skillList::addSkill(), skillList::listOfSkills(), skillList::listOfSkillString(), skillList::skillCount(), and skillList::XMLout().
Here is the caller graph for this function:
char * skillEntry::getSkill | ( | ) |
Return the string value for this skill
Definition at line 84 of file skill-entry.cpp.
Referenced by skillList::addSkill(), and skillList::listOfSkillString().
Here is the caller graph for this function:
void skillEntry::setLevel | ( | int | ) |
Set the level of skill for this skill entry.
int | -- integer value to set this skill entry level to. |
Definition at line 80 of file skill-entry.cpp.
Referenced by skillList::addSkill(), and skillList::skillList().
Here is the caller graph for this function:
void skillEntry::setNext | ( | skillEntry * | ) |
Set the value of the pointer pointing to the next skill in the list.
Definition at line 73 of file skill-entry.cpp.
Referenced by skillList::addSkill().
Here is the caller graph for this function:
void skillEntry::setSkill | ( | char * | ) |
Assign the string value for this skill entry.
(char*) | pointer to the string representation we want to set. |
Definition at line 89 of file skill-entry.cpp.
Referenced by skillList::skillList().
Here is the caller graph for this function:
char * skillEntry::toString | ( | ) |
Convert this object to a string.
Definition at line 96 of file skill-entry.cpp.
Referenced by skillList::listOfSkills().
00096 { 00097 char rvalue[10]; // I doubt it should ever be more than that. 00098 char *buffer; // This will evenually be our return value 00099 00100 sprintf(rvalue,"%d",this->getLevel()); 00101 buffer=(char*)malloc(strlen(this->getSkill()) + strlen(FILLER) + 00102 strlen(rvalue) + 1 ); 00103 sprintf(buffer,"%s%s%s",this->getSkill(),FILLER,rvalue); 00104 return buffer; 00105 }
Here is the caller graph for this function:
void skillEntry::XMLout | ( | FILE * | fout | ) |
Send this object to an XML formatted file.
fout | pointer to a file buffer. |
Definition at line 107 of file skill-entry.cpp.
Referenced by skillList::XMLout().
00107 { 00108 00109 fprintf(fout,"\t\t%s\n",createStartElement("skill")); 00110 fprintf(fout,"\t\t\t%s%s%s\n", 00111 createStartElement("skill-name"), 00112 this->getSkill(), 00113 createEndElement("skill-name") 00114 ); 00115 fprintf(fout,"\t\t\t%s%d%s\n", 00116 createStartElement("skill-level"), 00117 this->getLevel(), 00118 createEndElement("skill-level")); 00119 fprintf(fout,"\t\t%s\n",createEndElement("skill")); 00120 00121 }
Here is the caller graph for this function: