Initial commit
This commit is contained in:
parent
8373ac7878
commit
ec2a365bab
Binary file not shown.
|
@ -1,144 +0,0 @@
|
|||
// CheckInterface.cpp: implementation of the CheckInterface class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "CheckInterface.h"
|
||||
|
||||
|
||||
bool CheckInterface::check(Person& person, const bool _check_repe) const {
|
||||
unsigned i = 0, j = 0; //common loop variable
|
||||
string re_write = ""; //rewrite tel and qq(if valid) into good format
|
||||
vector<string> temp_str;
|
||||
bool mailFlag = false; //check mailbox's format
|
||||
//===============================
|
||||
|
||||
if (!((strlen(person.name)>0) && (strlen(person.tel)>0) && (strlen(person.addr)>0)) ){
|
||||
errorMsg = "Name/Tel/Address is null.";
|
||||
return false;
|
||||
}
|
||||
//===============================
|
||||
|
||||
if (_check_repe){ //here to use _check_repe only once.
|
||||
for (i = 0; i < contact_item.size(); i++)
|
||||
if (strcmp(person.name,&*contact_item[i]->name) == 0){
|
||||
errorMsg = "Item already exists.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//===============================
|
||||
|
||||
for (i = 0; i<strlen(person.tel); i++){
|
||||
if (!(( (person.tel[i]>='0')&&(person.tel[i]<='9') ) || (person.tel[i] == ','))){
|
||||
errorMsg = "Unknown character in Tel option.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
temp_str = this->part_tq(person, "tel");
|
||||
re_write = "";
|
||||
for (i = 0; i<temp_str.size(); i++){
|
||||
for (j = i + 1; j<temp_str.size();j++){
|
||||
if ((temp_str.at(i) == temp_str.at(j)) && (temp_str.at(i) != "")){
|
||||
errorMsg = "Duplicated Tel number(s).";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (temp_str.at(i) != ""){
|
||||
re_write += temp_str.at(i);
|
||||
re_write += ",";
|
||||
}
|
||||
}
|
||||
re_write = re_write.substr(0,re_write.length()-1);
|
||||
strcpy(person.tel,re_write.c_str());
|
||||
//===============================
|
||||
|
||||
if (person.sex != '\0'){
|
||||
if ((person.sex == 'f') || (person.sex == 'm'))
|
||||
person.sex -=32;
|
||||
if ( !( (person.sex == 'F') || (person.sex == 'M') ) ){
|
||||
errorMsg = "Unknown character in Gender option.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//===============================
|
||||
|
||||
if (strcmp(person.mail,"") != 0){
|
||||
mailFlag = false;
|
||||
for (i = 0; i<strlen(person.mail); ++i){
|
||||
if (person.mail[i] == '@'){
|
||||
if (mailFlag){
|
||||
errorMsg = "Format of Mailbox fill is incorrect.";
|
||||
return false;
|
||||
}
|
||||
(!mailFlag) && (mailFlag = true);
|
||||
}
|
||||
}//for
|
||||
if (!mailFlag){
|
||||
errorMsg = "Format of Mailbox fill is incorrect.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//===============================
|
||||
|
||||
if (strcmp(person.qq, "") != 0){
|
||||
re_write = "";
|
||||
for (i = 0; i<strlen(person.qq); i++)
|
||||
if (!(( (person.qq[i]>='0')&&(person.qq[i]<='9') ) || (person.qq[i] == ','))){
|
||||
errorMsg = "Unknown character in QQ option.";
|
||||
return false;
|
||||
}
|
||||
temp_str.clear();
|
||||
temp_str = this->part_tq(person, "qq");
|
||||
for (i = 0; i<temp_str.size(); i++){
|
||||
for (j = i + 1; j<temp_str.size();j++){
|
||||
if (temp_str.at(i) == temp_str.at(j)){
|
||||
errorMsg = "Duplicated QQ number(s).";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (temp_str.at(i) != ""){
|
||||
re_write += temp_str.at(i);
|
||||
re_write += ",";
|
||||
}
|
||||
}
|
||||
re_write = re_write.substr(0,re_write.length()-1);
|
||||
strcpy(person.qq,re_write.c_str());
|
||||
}
|
||||
return true;
|
||||
//===============================
|
||||
//...
|
||||
}
|
||||
|
||||
bool CheckInterface::check_exact(const Person& index, const string info_str) const{
|
||||
if (strcmp(index.name,info_str.c_str()) == 0)
|
||||
return true;
|
||||
vector<string> temp_vec = part_tq(index, "tel");
|
||||
for (unsigned i = 0; i<temp_vec.size(); i++){
|
||||
if (strcmp(temp_vec.at(i).c_str(),info_str.c_str()) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
vector<string> CheckInterface::part_tq(const Person& person, const char* const TEL_QQ) const {
|
||||
vector<string> rtn_vec;
|
||||
string src_str;
|
||||
string temp_str = "";
|
||||
if (strcmp(TEL_QQ,"tel") == 0)
|
||||
src_str = person.tel;
|
||||
else if (strcmp(TEL_QQ,"qq") == 0)
|
||||
src_str = person.qq;
|
||||
else
|
||||
return rtn_vec;
|
||||
|
||||
for (unsigned i = 0; i<strlen(src_str.c_str()); i++){
|
||||
if (src_str[i] == ','){
|
||||
rtn_vec.push_back(temp_str);
|
||||
temp_str = "";
|
||||
}
|
||||
else
|
||||
temp_str += src_str[i];
|
||||
}
|
||||
rtn_vec.push_back(temp_str);
|
||||
return rtn_vec;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
// CheckInterface.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CHECKINTERFACE_H__ABFADC84_DBE2_4985_9360_97CF317116D0__INCLUDED_)
|
||||
#define AFX_CHECKINTERFACE_H__ABFADC84_DBE2_4985_9360_97CF317116D0__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "Person.h"
|
||||
|
||||
class CheckInterface
|
||||
{
|
||||
private:
|
||||
vector<string> part_tq(const Person&, const char* const) const;
|
||||
public:
|
||||
virtual ~CheckInterface(){};
|
||||
bool check(Person&, const bool _check_repe) const;
|
||||
bool check_exact(const Person&, const string) const; //check if index.name == info_str
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_CHECKINTERFACE_H__ABFADC84_DBE2_4985_9360_97CF317116D0__INCLUDED_)
|
108
src2/Contact.cpp
108
src2/Contact.cpp
|
@ -1,108 +0,0 @@
|
|||
|
||||
#include "stdafx.h"
|
||||
#include "Contact.h"
|
||||
|
||||
extern vector<Person*> contact_item;
|
||||
extern string errorMsg;
|
||||
|
||||
Contact::Contact()
|
||||
{
|
||||
MainFunctionsNum = 5;
|
||||
refresh();
|
||||
}
|
||||
|
||||
Contact::~Contact()
|
||||
{
|
||||
int freei = contact_item.size();
|
||||
for (int i = 0; i<freei; ++i){
|
||||
delete(contact_item.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
MainStrategy* Contact::setMainStrategy(int num){
|
||||
switch (num){
|
||||
case 1:
|
||||
return new MainNewMenu();
|
||||
case 2:
|
||||
return new MainDelMenu();
|
||||
case 3:
|
||||
return new MainMdfMenu();
|
||||
case 4:
|
||||
return new MainVewMenu();
|
||||
case 5:
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Contact::removeMainStrategy(MainStrategy* p){
|
||||
delete p;
|
||||
}
|
||||
|
||||
void Contact::welcome() const{
|
||||
int n = 0;
|
||||
system("cls");
|
||||
cout<<"\n\n\n----------Welcome to the Address Book System.--------\n\n";
|
||||
cout<<"-----now LOADING address book...";
|
||||
n = refresh();
|
||||
Sleep(800);
|
||||
if (n > 0){
|
||||
cout<<"\t"<<n<<" contact(s) have been imported.\n";
|
||||
}
|
||||
else if (n == -1){
|
||||
cout<<"\tFolder contact does not exist!.Please retry later!\n";
|
||||
getch();
|
||||
exit(0);
|
||||
}
|
||||
else{
|
||||
cout<<"\t"<<"no contact has been imported.\n";
|
||||
}
|
||||
Sleep(50);
|
||||
cout<<" Login...";
|
||||
Sleep(300);
|
||||
cout<<" Successful!";
|
||||
Sleep(40);
|
||||
}
|
||||
|
||||
|
||||
int Contact::refresh() const{
|
||||
|
||||
string info_check;
|
||||
contact_item.clear();
|
||||
|
||||
long hFile = 0;
|
||||
struct _finddata_t fileinfo;
|
||||
const char* cp = ".\\contact\\*";
|
||||
const char* dir = ".\\contact";
|
||||
|
||||
int freei = contact_item.size();
|
||||
for (int i = 0; i<freei; ++i){
|
||||
delete(contact_item.at(i));
|
||||
}
|
||||
|
||||
if ((hFile = _findfirst(cp, &fileinfo)) != -1){
|
||||
do{
|
||||
if (!(fileinfo.attrib & _A_SUBDIR)){
|
||||
string path = ".\\contact\\";
|
||||
path += fileinfo.name;
|
||||
|
||||
Person *temp_p = new Person;
|
||||
FILE* fp = fopen(path.c_str(), "rb");
|
||||
|
||||
fread(temp_p, sizeof(*temp_p), 1, fp);
|
||||
fclose(fp);
|
||||
info_check = temp_p->name;
|
||||
info_check += ".ctt";
|
||||
if (info_check == fileinfo.name)
|
||||
contact_item.push_back(temp_p);
|
||||
}
|
||||
|
||||
} while (_findnext(hFile, &fileinfo) == 0);
|
||||
_findclose(hFile);
|
||||
}
|
||||
else{
|
||||
if (!CreateDirectory(dir, NULL)) return -1;
|
||||
}
|
||||
return contact_item.size();
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
// Contact.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_Contact_H__578FBE4B_85A0_4A32_B651_7CF4D553E488__INCLUDED_)
|
||||
#define AFX_Contact_H__578FBE4B_85A0_4A32_B651_7CF4D553E488__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
#include "ContactInterface.h"
|
||||
#include "ContactInit.h"
|
||||
#include "MainNewMenu.h"
|
||||
#include "MainDelMenu.h"
|
||||
#include "MainMdfMenu.h"
|
||||
#include "MainVewMenu.h"
|
||||
|
||||
|
||||
class Contact : public ContactInterface, public ContactInit
|
||||
{
|
||||
private:
|
||||
MainStrategy* setMainStrategy(int); //override from ContactInterface
|
||||
void removeMainStrategy(MainStrategy*); //...
|
||||
int refresh() const; //override from ContactInit
|
||||
void welcome() const; //...
|
||||
public:
|
||||
Contact();
|
||||
~Contact();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_Contact_H__578FBE4B_85A0_4A32_B651_7CF4D553E488__INCLUDED_)
|
|
@ -1,20 +0,0 @@
|
|||
// ContactInit.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CONTACTINIT_H__5C8BC83A_4BE8_4C6A_A36F_6CF4CC06AA7B__INCLUDED_)
|
||||
#define AFX_CONTACTINIT_H__5C8BC83A_4BE8_4C6A_A36F_6CF4CC06AA7B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
class ContactInit
|
||||
{
|
||||
public:
|
||||
virtual ~ContactInit(){};
|
||||
virtual int refresh() const = 0;
|
||||
virtual void welcome() const= 0;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_CONTACTINIT_H__5C8BC83A_4BE8_4C6A_A36F_6CF4CC06AA7B__INCLUDED_)
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
#include "stdafx.h"
|
||||
#include "ContactInterface.h"
|
||||
|
||||
extern vector<Person*> contact_item;
|
||||
extern string errorMsg;
|
||||
|
||||
int ContactInterface::main_menu(){
|
||||
char rtn_int;
|
||||
int fuckin_stupid = 0;
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
do{
|
||||
system("cls");
|
||||
readFile(".\\io\\MainMenu.io");
|
||||
if (fuckin_stupid != 0)
|
||||
cout<<"\t\tError Inputing!\n";
|
||||
cout<<"\tEnter number[1-"<<MainFunctionsNum<<"] to select the corresponding function: ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
rtn_int = getch();
|
||||
fuckin_stupid++;
|
||||
}while((rtn_int<'1') || (rtn_int>'0' + MainFunctionsNum));
|
||||
|
||||
mainStrategy = setMainStrategy(rtn_int-'0');
|
||||
if (mainStrategy == NULL){
|
||||
return -1;
|
||||
}
|
||||
mainStrategy->doMainStrategy();
|
||||
removeMainStrategy(mainStrategy);
|
||||
return 0;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
// ContactInterface.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CONTACTINTERFACE_H__61397655_84DB_48A0_A5E4_041E75321807__INCLUDED_)
|
||||
#define AFX_CONTACTINTERFACE_H__61397655_84DB_48A0_A5E4_041E75321807__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainStrategy.h"
|
||||
#include "CheckInterface.h"
|
||||
#include "PrtMenuInterface.h"
|
||||
|
||||
class ContactInterface : public PrtMenuInterface
|
||||
{
|
||||
private:
|
||||
MainStrategy* mainStrategy;
|
||||
virtual MainStrategy* setMainStrategy(int) = 0;
|
||||
virtual void removeMainStrategy(MainStrategy*) = 0;
|
||||
protected:
|
||||
int MainFunctionsNum;
|
||||
public:
|
||||
int main_menu();
|
||||
virtual ~ContactInterface(){};
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_CONTACTINTERFACE_H__61397655_84DB_48A0_A5E4_041E75321807__INCLUDED_)
|
|
@ -1,41 +0,0 @@
|
|||
// MainDelMenu.cpp: implementation of the MainDelMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainDelMenu.h"
|
||||
|
||||
MainDelMenu::doMainStrategy()
|
||||
{
|
||||
int num = contact_item.size();
|
||||
int index = 0;
|
||||
string addr = ".\\contact\\";
|
||||
system("cls");
|
||||
cout<<endl;
|
||||
cout<<"=====Delete Contact====================\n\n";
|
||||
if (num > 1){
|
||||
printAll();
|
||||
cout<<"\n\tEnter the INDEX(1 - "<<num<<") of the information you want to DELETE:(0 for quit) ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>index;
|
||||
if ((index<0) || (index>num)){
|
||||
cout<<"\n\n\t\tError Input!\n";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getch();
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
else if ( num == 1)
|
||||
index = 1;
|
||||
if (index == 0)
|
||||
return 0;
|
||||
index--;
|
||||
print_prsn(*contact_item[index],"=====Delete Contact====================\n",true);
|
||||
delete_prsn(*contact_item[index]);
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// MainDelMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINDELMENU_H__59F8280E_220C_4D11_9B6E_96B22BB96034__INCLUDED_)
|
||||
#define AFX_MAINDELMENU_H__59F8280E_220C_4D11_9B6E_96B22BB96034__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainStrategy.h"
|
||||
|
||||
class MainDelMenu : public MainStrategy
|
||||
{
|
||||
public:
|
||||
virtual ~MainDelMenu(){};
|
||||
int doMainStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MAINDELMENU_H__59F8280E_220C_4D11_9B6E_96B22BB96034__INCLUDED_)
|
|
@ -1,41 +0,0 @@
|
|||
// MainMdfMenu.cpp: implementation of the MainMdfMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainMdfMenu.h"
|
||||
|
||||
MainMdfMenu::doMainStrategy()
|
||||
{
|
||||
int num = contact_item.size();
|
||||
int index = 0;
|
||||
|
||||
system("cls");
|
||||
cout<<endl;
|
||||
cout<<"=====Modify Contact====================\n\n";
|
||||
if (num > 1){
|
||||
printAll();
|
||||
cout<<"\n\tEnter the INDEX(1 - "<<num<<") of the information you want to MODIFY:(0 for quit) ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>index;
|
||||
if ( (index<0) || (index>num) ){
|
||||
cout<<"\n\t\tError Input!\n";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getch();
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
else if ( num == 1)
|
||||
index = 1;
|
||||
if (index == 0)
|
||||
return 0;
|
||||
index--;
|
||||
|
||||
modify_prsn(*contact_item.at(index));
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getch();
|
||||
return 0;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// MainMdfMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINMDFMENU_H__4AF95322_636F_4CB7_B574_C8FB878AFB87__INCLUDED_)
|
||||
#define AFX_MAINMDFMENU_H__4AF95322_636F_4CB7_B574_C8FB878AFB87__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainStrategy.h"
|
||||
|
||||
class MainMdfMenu : public MainStrategy
|
||||
{
|
||||
public:
|
||||
virtual ~MainMdfMenu(){};
|
||||
int doMainStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MAINMDFMENU_H__4AF95322_636F_4CB7_B574_C8FB878AFB87__INCLUDED_)
|
|
@ -1,107 +0,0 @@
|
|||
// MainNewMenu.cpp: implementation of the MainNewMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainNewMenu.h"
|
||||
|
||||
MainNewMenu::doMainStrategy()
|
||||
{
|
||||
system("cls");
|
||||
cout<<endl;
|
||||
cout<<"=====New Contact====================\n\n";
|
||||
if(!create())
|
||||
cout<<"\n\n\t\tInfomation Error!";
|
||||
else
|
||||
cout<<"\n\n\t\tInfomation Entry Success!";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool MainNewMenu::create() const{
|
||||
Person t_info;
|
||||
string t_str = "";
|
||||
cout<<"You can use ',[en]'(NOT '£¬[chs]') to enter more than one data(Only for *Tel and *QQ)"<<endl<<endl;
|
||||
cout<<"Name:";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>t_info.name;
|
||||
cout<<"Address:";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>t_info.addr;
|
||||
cout<<"*Tel:";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>t_info.tel;
|
||||
|
||||
char t_c;
|
||||
cout<<"\n\tthe following data can be set as NULL.Press ENTER to skip\n\n";
|
||||
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
|
||||
cout<<"Gender:(M for Male, F for Female)";
|
||||
char _c= getchar();
|
||||
if (_c != '\n')
|
||||
t_info.sex = _c;
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
|
||||
cout<<"Zip:";
|
||||
while((t_c = getchar()) != '\n'){
|
||||
t_str += t_c;
|
||||
}
|
||||
strcpy(t_info.zip,t_str.c_str());
|
||||
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
t_str = "";
|
||||
|
||||
cout<<"Mailbox:";
|
||||
while((t_c = getchar()) != '\n'){
|
||||
t_str += t_c;
|
||||
}
|
||||
strcpy(t_info.mail,t_str.c_str());
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
t_str = "";
|
||||
|
||||
cout<<"*QQ:";
|
||||
while((t_c = getchar()) != '\n'){
|
||||
t_str += t_c;
|
||||
}
|
||||
strcpy(t_info.qq, t_str.c_str());
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
t_str = "";
|
||||
|
||||
cout<<"Category:";
|
||||
while((t_c = getchar()) != '\n'){
|
||||
t_str += t_c;
|
||||
}
|
||||
strcpy(t_info.category,t_str.c_str());
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
t_str = "";
|
||||
|
||||
if(!check(t_info, true) ){
|
||||
cout<<"\n\t\t"<<errorMsg<<endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------
|
||||
char _char[30] = "";
|
||||
char* t_addr = _char;
|
||||
sprintf(t_addr,".\\contact\\%s.ctt",t_info.name);
|
||||
|
||||
|
||||
FILE* fp = fopen(t_addr ,"wb+");
|
||||
if(fwrite(&t_info, sizeof(t_info), 1, fp) != 1)
|
||||
printf("err");
|
||||
fclose(fp);
|
||||
//--------------------------------------------------------
|
||||
return true;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
// MainNewMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINNEWMENU_H__FAE001ED_B300_4102_8F33_09E79DFDAEA6__INCLUDED_)
|
||||
#define AFX_MAINNEWMENU_H__FAE001ED_B300_4102_8F33_09E79DFDAEA6__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainStrategy.h"
|
||||
|
||||
class MainNewMenu : public MainStrategy
|
||||
{
|
||||
private:
|
||||
bool create() const;
|
||||
public:
|
||||
virtual ~MainNewMenu(){};
|
||||
int doMainStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MAINNEWMENU_H__FAE001ED_B300_4102_8F33_09E79DFDAEA6__INCLUDED_)
|
|
@ -1,184 +0,0 @@
|
|||
// MainStrategy.cpp: implementation of the MainStrategy class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainStrategy.h"
|
||||
|
||||
void MainStrategy::print_prsn(const Person& prt_Person, const string info, bool refresh) const{
|
||||
system("cls");
|
||||
cout<<endl<<info;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tName: "<<prt_Person.name;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tTel: "<<prt_Person.tel;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tAddress: "<<prt_Person.addr;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tGendle: "<<prt_Person.sex ;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tZip: "<<prt_Person.zip;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tMail: "<<prt_Person.mail;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tQQ: "<<prt_Person.qq;
|
||||
if(refresh) Sleep(20);
|
||||
cout<<"\n\tCategory: "<<prt_Person.category;
|
||||
if(refresh) Sleep(20);
|
||||
}
|
||||
|
||||
void MainStrategy::printAll() const{
|
||||
int num = contact_item.size();
|
||||
|
||||
for (int i = 0; i < num; i++){
|
||||
cout<<"("<<i+1<<"): "<<&*contact_item[i]->name<<" TEL: "<<&*contact_item[i]->tel<<" ADDR: "<<&*contact_item[i]->addr<<endl;
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool MainStrategy::delete_prsn(Person& del_Person) const{
|
||||
char y_n;
|
||||
string addr = ".\\contact\\";
|
||||
cout<<"\n\n\t\tReally want to delete?[y/n]: ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
|
||||
y_n = getch();
|
||||
if ((y_n == 'y') || (y_n == 'Y')){
|
||||
addr += del_Person.name;
|
||||
addr += ".ctt";
|
||||
if (remove(addr.c_str())){
|
||||
cout<<"\n\t\tError removing data!\n";
|
||||
return false;
|
||||
}
|
||||
cout<<"\n\t\tDelete Successful!\n";
|
||||
return true;
|
||||
}
|
||||
else
|
||||
cout<<"\n\t\tCanceled!\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MainStrategy::modify_prsn(Person& m_Person) const{
|
||||
char t_c;
|
||||
char y_n;
|
||||
string addr = ".\\contact\\";
|
||||
string t_str = "";
|
||||
addr += m_Person.name;
|
||||
addr += ".ctt";
|
||||
Person t_info = m_Person;
|
||||
|
||||
system("cls");
|
||||
cout<<endl<<"=====Modify Contact====================(Enter a new value at the cursor.ENTER to SKIP.)\n";
|
||||
cout<<"\n When you entering Tel and QQ information, you can input '+' at the beginning to add the data to the end of the existing data.\n I will remind you later.(*)\n";
|
||||
|
||||
cout<<"\n\tName: "<<m_Person.name;
|
||||
cout<<"\n\t*Tel: "<<m_Person.tel<<"\t:(eg:+12345) ";
|
||||
cin.clear();cin.sync();
|
||||
t_str = "";
|
||||
while((t_c = getchar()) != '\n')
|
||||
{t_str += t_c;}
|
||||
if (t_str[0] == '+'){
|
||||
t_str = t_str.substr(1, t_str.length());
|
||||
string _t_str = t_info.tel;
|
||||
_t_str += ",";
|
||||
_t_str += t_str;
|
||||
t_str = _t_str;
|
||||
strcpy(t_info.tel,t_str.c_str());
|
||||
}
|
||||
else{
|
||||
if (t_str != "") strcpy(t_info.tel,t_str.c_str());
|
||||
if (t_str == " ") strcpy(t_info.tel,"");
|
||||
}
|
||||
|
||||
cout<<"\tAddress: "<<m_Person.addr<<"\t: ";
|
||||
cin.clear();cin.sync();
|
||||
t_str = "";
|
||||
while((t_c = getchar()) != '\n')
|
||||
{t_str += t_c;}
|
||||
if (t_str != "") strcpy(t_info.addr,t_str.c_str());
|
||||
if (t_str == " ") strcpy(t_info.addr,"");
|
||||
|
||||
cout<<"\tGendle: "<<m_Person.sex <<"\t: ";
|
||||
|
||||
cin.clear();cin.sync();
|
||||
t_c= getchar();
|
||||
if (t_c != '\n')
|
||||
t_info.sex = t_c;
|
||||
if (t_c == ' ')
|
||||
t_info.sex = '\0';
|
||||
|
||||
cout<<"\tZip: "<<m_Person.zip<<"\t: ";
|
||||
cin.clear();cin.sync();
|
||||
t_str = "";
|
||||
while((t_c = getchar()) != '\n')
|
||||
{t_str += t_c;}
|
||||
if (t_str != "") strcpy(t_info.zip,t_str.c_str());
|
||||
if (t_str == " ") strcpy(t_info.zip,"");
|
||||
|
||||
cout<<"\tMail: "<<m_Person.mail<<"\t: ";
|
||||
cin.clear();cin.sync();
|
||||
t_str = "";
|
||||
while((t_c = getchar()) != '\n')
|
||||
{t_str += t_c;}
|
||||
if (t_str != "") strcpy(t_info.mail,t_str.c_str());
|
||||
if (t_str == " ") strcpy(t_info.mail,"");
|
||||
|
||||
cout<<"\t*QQ: "<<m_Person.qq<<"\t:(eg:+12345) ";
|
||||
cin.clear();cin.sync();
|
||||
t_str = "";
|
||||
while((t_c = getchar()) != '\n')
|
||||
{t_str += t_c;}
|
||||
if (t_str[0] == '+'){
|
||||
t_str = t_str.substr(1, t_str.length());
|
||||
string _t_str = t_info.qq;
|
||||
_t_str += ",";
|
||||
_t_str += t_str;
|
||||
t_str = _t_str;
|
||||
strcpy(t_info.qq,t_str.c_str());
|
||||
}
|
||||
else{
|
||||
if (t_str != "") strcpy(t_info.qq,t_str.c_str());
|
||||
if (t_str == " ") strcpy(t_info.qq,"");
|
||||
}
|
||||
|
||||
cout<<"\tCategory: "<<m_Person.category<<"\t: ";
|
||||
cin.clear();cin.sync();
|
||||
t_str = "";
|
||||
while((t_c = getchar()) != '\n')
|
||||
{t_str += t_c;}
|
||||
if (t_str != "") strcpy(t_info.category,t_str.c_str());
|
||||
if (t_str == " ") strcpy(t_info.category,"");
|
||||
|
||||
this->print_prsn(t_info,"=====Modify Contact====================\n",true);
|
||||
cout<<"\n\n\t\tReally want to modify?[y/n]: ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
y_n = getch();
|
||||
if ((y_n == 'y') || (y_n == 'Y')){
|
||||
if(!check(t_info, false) ){
|
||||
cout<<"\n\t\tInfomation Error!";
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
FILE *fp = fopen(addr.c_str(),"wb+");
|
||||
if (fp == NULL ){
|
||||
cout<<"\n\t\tError opening file!\n";
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if (fwrite(&t_info,sizeof(Person), 1, fp) != 1){
|
||||
cout<<"\n\t\tError writing to file!\n";
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
cout<<"\n\t\tModify succeed!\n";
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
cout<<"\n\t\tCanceled!\n";
|
||||
return true;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
// MainStrategy.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINSTRATEGY_H__EC9C2730_7A1B_40AF_AB90_CC8AC25EC1B5__INCLUDED_)
|
||||
#define AFX_MAINSTRATEGY_H__EC9C2730_7A1B_40AF_AB90_CC8AC25EC1B5__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "CheckInterface.h"
|
||||
|
||||
class MainStrategy : public CheckInterface
|
||||
{
|
||||
public:
|
||||
virtual ~MainStrategy(){};
|
||||
virtual int doMainStrategy() = 0;
|
||||
protected:
|
||||
void printAll() const;
|
||||
void print_prsn(const Person&, const string, bool) const;
|
||||
bool delete_prsn(Person&) const;
|
||||
bool modify_prsn(Person&) const; //Way to modify a spefic Person member
|
||||
};
|
||||
|
||||
//extern vector<Person*> contact_item;
|
||||
|
||||
#endif // !defined(AFX_MAINSTRATEGY_H__EC9C2730_7A1B_40AF_AB90_CC8AC25EC1B5__INCLUDED_)
|
|
@ -1,20 +0,0 @@
|
|||
// MainTestMenu.cpp: implementation of the MainTestMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainTestMenu.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
MainTestMenu::MainTestMenu()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MainTestMenu::~MainTestMenu()
|
||||
{
|
||||
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
// MainTestMenu.h: interface for the MainTestMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINTESTMENU_H__4F0A9680_D41C_411A_B456_680B37EB8308__INCLUDED_)
|
||||
#define AFX_MAINTESTMENU_H__4F0A9680_D41C_411A_B456_680B37EB8308__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainStrategy.h"
|
||||
|
||||
class MainTestMenu : public MainStrategy
|
||||
{
|
||||
public:
|
||||
MainTestMenu();
|
||||
virtual ~MainTestMenu();
|
||||
virtual int doMainStrategy(){
|
||||
cout<<"test!\n";
|
||||
getch();
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MAINTESTMENU_H__4F0A9680_D41C_411A_B456_680B37EB8308__INCLUDED_)
|
|
@ -1,32 +0,0 @@
|
|||
// MainVewMenu.cpp: implementation of the MainVewMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainVewMenu.h"
|
||||
|
||||
MainVewMenu::MainVewMenu(){
|
||||
ViewFunctionsNum = 5;
|
||||
}
|
||||
|
||||
ViewStrategy* MainVewMenu::setViewStrategy(int slct_num){
|
||||
|
||||
switch(slct_num){
|
||||
case 1:
|
||||
return new ViewExactMenu();
|
||||
case 2:
|
||||
return new ViewFuzzyMenu();
|
||||
case 3:
|
||||
return new ViewCategoryMenu();
|
||||
case 4:
|
||||
return new ViewAllMenu();
|
||||
case 5:
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void MainVewMenu::removeViewStrategy(ViewStrategy* p){
|
||||
delete p;
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
// MainVewMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINVEWMENU_H__30EDC353_618B_4196_A8BB_4A59557068CD__INCLUDED_)
|
||||
#define AFX_MAINVEWMENU_H__30EDC353_618B_4196_A8BB_4A59557068CD__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainVewMenuInterface.h"
|
||||
|
||||
#include "ViewExactMenu.h"
|
||||
#include "ViewAllMenu.h"
|
||||
#include "ViewCategoryMenu.h"
|
||||
#include "ViewFuzzyMenu.h"
|
||||
|
||||
class MainVewMenu : public MainVewMenuInterface
|
||||
{
|
||||
private:
|
||||
ViewStrategy* setViewStrategy(int);
|
||||
void removeViewStrategy(ViewStrategy*);
|
||||
public:
|
||||
MainVewMenu();
|
||||
virtual ~MainVewMenu(){};
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MAINVEWMENU_H__30EDC353_618B_4196_A8BB_4A59557068CD__INCLUDED_)
|
|
@ -1,84 +0,0 @@
|
|||
// MainVewMenuInterface.cpp: implementation of the MainVewMenuInterface class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MainVewMenuInterface.h"
|
||||
|
||||
void sleep(){
|
||||
Sleep(20);
|
||||
return;
|
||||
}
|
||||
|
||||
int MainVewMenuInterface::view(Person* v_Person) const{
|
||||
if (v_Person == NULL)
|
||||
return -1;
|
||||
bool refresh = true;
|
||||
string addr = ".\\contact\\";
|
||||
int fuckin_stupid = 0;
|
||||
int slct_num = 0;
|
||||
do{
|
||||
print_prsn(*v_Person,"=====VIEW Contact====================\n",refresh);
|
||||
if (refresh){
|
||||
readFile(".\\io\\View.io",sleep);
|
||||
}
|
||||
else{
|
||||
readFile(".\\io\\View.io");
|
||||
}
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
if (fuckin_stupid != 0)
|
||||
cout<<"\t\tError Inputing!\n";
|
||||
cout<<"\tEnter number[1-3] to select the corresponding function: ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
slct_num = getch();
|
||||
fuckin_stupid++;
|
||||
refresh = false;
|
||||
}while((slct_num<'1') || (slct_num>'3'));
|
||||
|
||||
switch (slct_num){
|
||||
case '1':
|
||||
delete_prsn(*v_Person);
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getch();
|
||||
break;
|
||||
case '2':
|
||||
modify_prsn(*v_Person);
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getch();
|
||||
break;
|
||||
case '3':
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MainVewMenuInterface::doMainStrategy()
|
||||
{
|
||||
int fuckin_stupid = 0;
|
||||
char slct_num = 0;
|
||||
do{
|
||||
system("cls");
|
||||
readFile(".\\io\\ViewMenu.io");
|
||||
|
||||
if (fuckin_stupid != 0)
|
||||
cout<<"\t\tError Inputing!\n";
|
||||
cout<<"\tEnter number[1-"<<ViewFunctionsNum<<"] to select the corresponding function: ";
|
||||
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
slct_num = getch();
|
||||
fuckin_stupid++;
|
||||
}while((slct_num<'1') || (slct_num>'0' + ViewFunctionsNum));
|
||||
|
||||
viewStrategy = setViewStrategy(slct_num - '0');
|
||||
if (viewStrategy == NULL)
|
||||
return -1;
|
||||
view(viewStrategy->doViewStrategy());
|
||||
removeViewStrategy(viewStrategy);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
// MainVewMenuInterface.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINVEWMENUINTERFACE_H__7A32F346_890E_45E1_941B_4FC6A6A3714A__INCLUDED_)
|
||||
#define AFX_MAINVEWMENUINTERFACE_H__7A32F346_890E_45E1_941B_4FC6A6A3714A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "MainStrategy.h"
|
||||
#include "ViewStrategy.h"
|
||||
#include "PrtMenuInterface.h"
|
||||
|
||||
class MainVewMenuInterface : public MainStrategy, public PrtMenuInterface
|
||||
{
|
||||
private:
|
||||
ViewStrategy* viewStrategy;
|
||||
|
||||
virtual int view(Person* v_Person) const; //View a Person member with details
|
||||
virtual ViewStrategy* setViewStrategy(int) = 0;
|
||||
virtual void removeViewStrategy(ViewStrategy*) = 0;
|
||||
protected:
|
||||
int ViewFunctionsNum;
|
||||
public:
|
||||
virtual ~MainVewMenuInterface(){};
|
||||
int doMainStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_MAINVEWMENUINTERFACE_H__7A32F346_890E_45E1_941B_4FC6A6A3714A__INCLUDED_)
|
|
@ -1,19 +0,0 @@
|
|||
|
||||
#include "stdafx.h"
|
||||
#include "Person.h"
|
||||
|
||||
Person::Person()
|
||||
{
|
||||
strcpy(this->addr,"");
|
||||
strcpy(this->category,"");
|
||||
strcpy(this->mail, "");
|
||||
strcpy(this->name, "");
|
||||
strcpy(this->qq, "");
|
||||
this->sex = '\0';
|
||||
strcpy(this->tel, "");
|
||||
strcpy(this->zip, "");
|
||||
}
|
||||
|
||||
Person::~Person()
|
||||
{
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
// Person.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_Person_H__4EDC1B44_F6DC_404A_ADA9_E56095080841__INCLUDED_)
|
||||
#define AFX_Person_H__4EDC1B44_F6DC_404A_ADA9_E56095080841__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define MAXNAME 100
|
||||
#define MAXTEL 80
|
||||
#define MAXADDR 100
|
||||
#define MAXZIP 10
|
||||
#define MAXMAIL 80
|
||||
#define MAXQQ 40
|
||||
#define MAXCTGY 20
|
||||
|
||||
class Person
|
||||
{
|
||||
public:
|
||||
Person();
|
||||
~Person();
|
||||
char name[MAXNAME];
|
||||
char sex;
|
||||
char tel[MAXTEL];
|
||||
char addr[MAXADDR];
|
||||
char zip[MAXZIP];
|
||||
char mail[MAXMAIL];
|
||||
char qq[MAXQQ];
|
||||
char category[MAXCTGY];
|
||||
};
|
||||
|
||||
extern vector<Person*> contact_item;
|
||||
extern string errorMsg;
|
||||
|
||||
#endif // !defined(AFX_Person_H__4EDC1B44_F6DC_404A_ADA9_E56095080841__INCLUDED_)
|
|
@ -1,25 +0,0 @@
|
|||
// PrtMenuInterface.cpp: implementation of the PrtMenuInterface class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "PrtMenuInterface.h"
|
||||
|
||||
bool PrtMenuInterface::readFile(const char* file, void(*events)()) const{
|
||||
char line[1024];
|
||||
memset(line, 0, 1024);
|
||||
FILE* fp = fopen(file,"r");
|
||||
if (fp == NULL){
|
||||
return false;
|
||||
}
|
||||
while(!feof(fp)){
|
||||
fgets(line, 1024, fp);
|
||||
cout<<line;
|
||||
strcpy(line, "");
|
||||
if (events != NULL){
|
||||
events();
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
return true;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
// PrtMenuInterface.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_PRTMENUINTERFACE_H__77F54599_9711_43E8_97E8_278F62DD0880__INCLUDED_)
|
||||
#define AFX_PRTMENUINTERFACE_H__77F54599_9711_43E8_97E8_278F62DD0880__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
class PrtMenuInterface
|
||||
{
|
||||
protected:
|
||||
virtual bool readFile(const char*, void(*)() = NULL) const;
|
||||
public:
|
||||
virtual ~PrtMenuInterface(){};
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_PRTMENUINTERFACE_H__77F54599_9711_43E8_97E8_278F62DD0880__INCLUDED_)
|
|
@ -1,2 +0,0 @@
|
|||
# contacts
|
||||
c++ 课程设计
|
|
@ -1,20 +0,0 @@
|
|||
// ViewAllMenu.cpp: implementation of the ViewAllMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ViewAllMenu.h"
|
||||
|
||||
Person* ViewAllMenu::doViewStrategy(){
|
||||
int num = contact_item.size();
|
||||
vector<int> chosen_item;
|
||||
|
||||
ViewStrategy::all_vew();
|
||||
|
||||
for (int i = 0;i<num;i++){
|
||||
chosen_item.push_back(i);
|
||||
cout<<"("<<chosen_item.size()<<"): "<<&*contact_item[i]->name<<" TEL: "<<&*contact_item[i]->tel<<" ADDR: "<<&*contact_item[i]->addr<<endl;
|
||||
Sleep(20);
|
||||
}
|
||||
return anythingView(chosen_item);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// ViewAllMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_VIEWALLMENU_H__8C79467E_E8F5_483F_8EBE_66DD4CE77A44__INCLUDED_)
|
||||
#define AFX_VIEWALLMENU_H__8C79467E_E8F5_483F_8EBE_66DD4CE77A44__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ViewStrategy.h"
|
||||
|
||||
class ViewAllMenu : public ViewStrategy
|
||||
{
|
||||
public:
|
||||
virtual ~ViewAllMenu(){};
|
||||
Person* doViewStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_VIEWALLMENU_H__8C79467E_E8F5_483F_8EBE_66DD4CE77A44__INCLUDED_)
|
|
@ -1,21 +0,0 @@
|
|||
// ViewCategoryMenu.cpp: implementation of the ViewCategoryMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ViewCategoryMenu.h"
|
||||
|
||||
Person* ViewCategoryMenu::doViewStrategy(){
|
||||
string info_str = ViewStrategy::category_vew();
|
||||
int num = contact_item.size();
|
||||
vector<int> chosen_item;
|
||||
|
||||
for (int i = 0; i < num; i++){
|
||||
if (strcmp(&*contact_item[i]->category,info_str.c_str()) == 0 ){
|
||||
chosen_item.push_back(i);
|
||||
cout<<"("<<chosen_item.size()<<"): "<<&*contact_item[i]->name<<" TEL: "<<&*contact_item[i]->tel<<" ADDR: "<<&*contact_item[i]->addr<<endl;
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
return anythingView(chosen_item);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// ViewCategoryMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_VIEWCATEGORYMENU_H__48B023E6_1B4C_4082_A1E2_BB55EEC3B766__INCLUDED_)
|
||||
#define AFX_VIEWCATEGORYMENU_H__48B023E6_1B4C_4082_A1E2_BB55EEC3B766__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ViewStrategy.h"
|
||||
|
||||
class ViewCategoryMenu : public ViewStrategy
|
||||
{
|
||||
public:
|
||||
virtual ~ViewCategoryMenu(){};
|
||||
Person* doViewStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_VIEWCATEGORYMENU_H__48B023E6_1B4C_4082_A1E2_BB55EEC3B766__INCLUDED_)
|
|
@ -1,21 +0,0 @@
|
|||
// ViewExactMenu.cpp: implementation of the ViewExactMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ViewExactMenu.h"
|
||||
|
||||
Person* ViewExactMenu::doViewStrategy(){
|
||||
string info_str = ViewStrategy::title_vew("=====Exact Query Contact===============", "\tEnter infomation that needs to be querying: ");
|
||||
int num = contact_item.size();
|
||||
vector<int> chosen_item;
|
||||
|
||||
for (int i = 0; i < num; i++){
|
||||
if ( check_exact(*contact_item[i], info_str)){
|
||||
chosen_item.push_back(i);
|
||||
cout<<"("<<chosen_item.size()<<"): "<<&*contact_item[i]->name<<" TEL: "<<&*contact_item[i]->tel<<" ADDR: "<<&*contact_item[i]->addr<<endl;
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
return anythingView(chosen_item);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// ViewExactMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_VIEWEXACTMENU_H__33A9D84C_B321_4F0C_A59B_3777BF3AE004__INCLUDED_)
|
||||
#define AFX_VIEWEXACTMENU_H__33A9D84C_B321_4F0C_A59B_3777BF3AE004__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ViewStrategy.h"
|
||||
|
||||
class ViewExactMenu : public ViewStrategy
|
||||
{
|
||||
public:
|
||||
virtual ~ViewExactMenu(){};
|
||||
Person* doViewStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_VIEWEXACTMENU_H__33A9D84C_B321_4F0C_A59B_3777BF3AE004__INCLUDED_)
|
|
@ -1,21 +0,0 @@
|
|||
// ViewFuzzyMenu.cpp: implementation of the ViewFuzzyMenu class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ViewFuzzyMenu.h"
|
||||
|
||||
Person* ViewFuzzyMenu::doViewStrategy(){
|
||||
string info_str = ViewStrategy::title_vew("=====Fuzzy Query Contact===============", "\tEnter infomation that needs to be querying: ");
|
||||
int num = contact_item.size();
|
||||
vector<int> chosen_item;
|
||||
|
||||
for (int i = 0; i < num; i++){
|
||||
if ((strstr(&*contact_item[i]->addr,info_str.c_str()) != NULL) || (strstr(&*contact_item[i]->name ,info_str.c_str()) != NULL) || (strstr(&*contact_item[i]->tel ,info_str.c_str()) != NULL) ) {
|
||||
chosen_item.push_back(i);
|
||||
cout<<"("<<chosen_item.size()<<"): "<<&*contact_item[i]->name<<" TEL: "<<&*contact_item[i]->tel<<" ADDR: "<<&*contact_item[i]->addr<<endl;
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
return anythingView(chosen_item);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
// ViewFuzzyMenu.h: Application Library
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_VIEWFUZZYMENU_H__D10D5C93_EEF6_40EA_AEBB_C289EE09C1EF__INCLUDED_)
|
||||
#define AFX_VIEWFUZZYMENU_H__D10D5C93_EEF6_40EA_AEBB_C289EE09C1EF__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ViewStrategy.h"
|
||||
|
||||
class ViewFuzzyMenu : public ViewStrategy
|
||||
{
|
||||
public:
|
||||
virtual ~ViewFuzzyMenu(){};
|
||||
Person* doViewStrategy();
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_VIEWFUZZYMENU_H__D10D5C93_EEF6_40EA_AEBB_C289EE09C1EF__INCLUDED_)
|
|
@ -1,98 +0,0 @@
|
|||
// ViewStrategy.cpp: implementation of the ViewStrategy class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "ViewStrategy.h"
|
||||
|
||||
string ViewStrategy::title_vew(const char* title, const char* descp) const{
|
||||
string info_str;
|
||||
|
||||
system("cls");
|
||||
cout<<endl;
|
||||
cout<<title<<endl<<endl;
|
||||
cout<<descp;
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>info_str;
|
||||
cout<<endl;
|
||||
return info_str;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Person* ViewStrategy::anythingView(vector<int>& chosen_item) const{
|
||||
unsigned index = 0;
|
||||
|
||||
if (chosen_item.size() == 0){
|
||||
cout<<"\n\t\tNo Item Found!\n";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
getch();
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
if (chosen_item.size() == 1){
|
||||
Sleep(400);
|
||||
index = 1;
|
||||
}
|
||||
else{
|
||||
cout<<"\n\tEnter the INDEX(1 - "<<chosen_item.size()<<") of the information you want to VIEW:(0 for quit) ";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>index;
|
||||
if (index>chosen_item.size()){
|
||||
return NULL;
|
||||
}
|
||||
}//if (chosen_item.size() == 1)
|
||||
if (index > 0){
|
||||
return contact_item.at(chosen_item.at(index-1));
|
||||
}
|
||||
return NULL;
|
||||
}//if (chosen_item.size() == 0)
|
||||
}
|
||||
|
||||
void ViewStrategy::all_vew() const{
|
||||
system("cls");
|
||||
cout<<endl;
|
||||
cout<<"=====ALL Category======================\n\n";
|
||||
return;
|
||||
}
|
||||
|
||||
string ViewStrategy::category_vew() const{
|
||||
string info_str;
|
||||
vector<string> cur_ctg;
|
||||
string tmp_ctg;
|
||||
bool add_ctg;
|
||||
unsigned i = 0,j = 0;
|
||||
|
||||
system("cls");
|
||||
cout<<endl;
|
||||
cout<<"=====List by Category==================\n\n";
|
||||
cout<<"\tCurrent category:";
|
||||
for (i = 0; i<contact_item.size();i++){
|
||||
tmp_ctg = &*contact_item[i]->category;
|
||||
if (tmp_ctg == "")
|
||||
tmp_ctg = "Unset";
|
||||
add_ctg = true;
|
||||
for (j = 0; j<cur_ctg.size();j++){
|
||||
if (cur_ctg[j] == tmp_ctg)
|
||||
add_ctg = false;
|
||||
}
|
||||
if (add_ctg){
|
||||
cur_ctg.push_back(tmp_ctg);
|
||||
cout<<" "<<tmp_ctg;
|
||||
}
|
||||
}
|
||||
|
||||
cout<<"\n\n\tEnter category infomation:";
|
||||
cin.clear();
|
||||
cin.sync();
|
||||
cin>>info_str;
|
||||
if ((info_str == "Unset") || (info_str == "unset"))
|
||||
info_str = "";
|
||||
|
||||
cout<<endl;
|
||||
return info_str;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
// ViewStrategy.h: Frame Gallary
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_VIEWSTRATEGY_H__EC4D2837_CB82_4C72_90B0_0F5B88767A63__INCLUDED_)
|
||||
#define AFX_VIEWSTRATEGY_H__EC4D2837_CB82_4C72_90B0_0F5B88767A63__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "CheckInterface.h"
|
||||
|
||||
class ViewStrategy : public CheckInterface
|
||||
{
|
||||
protected:
|
||||
string title_vew(const char*, const char*) const; //for exact/fuzzy view
|
||||
void all_vew() const;
|
||||
string category_vew() const;
|
||||
Person* anythingView(vector<int>&) const;
|
||||
public:
|
||||
virtual ~ViewStrategy(){};
|
||||
virtual Person* doViewStrategy() = 0;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_VIEWSTRATEGY_H__EC4D2837_CB82_4C72_90B0_0F5B88767A63__INCLUDED_)
|
Binary file not shown.
Binary file not shown.
|
@ -1,237 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="contacts" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=contacts - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "contacts.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "contacts.mak" CFG="contacts - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "contacts - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "contacts - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "contacts - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x804 /d "NDEBUG"
|
||||
# ADD RSC /l 0x804 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "contacts - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x804 /d "_DEBUG"
|
||||
# ADD RSC /l 0x804 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "contacts - Win32 Release"
|
||||
# Name "contacts - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CheckInterface.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Contact.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ContactInterface.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainDelMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainMdfMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainNewMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainStrategy.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainVewMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainVewMenuInterface.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Person.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PrtMenuInterface.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewAllMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewCategoryMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewExactMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewFuzzyMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewStrategy.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CheckInterface.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Contact.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ContactInit.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ContactInterface.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainDelMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainMdfMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainNewMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainStrategy.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainVewMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainVewMenuInterface.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\person.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PrtMenuInterface.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewAllMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewCategoryMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewExactMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewFuzzyMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ViewStrategy.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "contacts"=".\contacts.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -1,147 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: contacts - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\Users\dell\AppData\Local\Temp\RSP7BD3.tmp" with contents
|
||||
[
|
||||
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"Debug/" /Fp"Debug/contacts.pch" /Yu"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
|
||||
"G:\Contact\CheckInterface.cpp"
|
||||
"G:\Contact\Contact.cpp"
|
||||
"G:\Contact\ContactInterface.cpp"
|
||||
"G:\Contact\main.cpp"
|
||||
"G:\Contact\MainDelMenu.cpp"
|
||||
"G:\Contact\MainMdfMenu.cpp"
|
||||
"G:\Contact\MainNewMenu.cpp"
|
||||
"G:\Contact\MainStrategy.cpp"
|
||||
"G:\Contact\MainVewMenu.cpp"
|
||||
"G:\Contact\MainVewMenuInterface.cpp"
|
||||
"G:\Contact\Person.cpp"
|
||||
"G:\Contact\PrtMenuInterface.cpp"
|
||||
"G:\Contact\ViewAllMenu.cpp"
|
||||
"G:\Contact\ViewCategoryMenu.cpp"
|
||||
"G:\Contact\ViewExactMenu.cpp"
|
||||
"G:\Contact\ViewFuzzyMenu.cpp"
|
||||
"G:\Contact\ViewStrategy.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\Users\dell\AppData\Local\Temp\RSP7BD3.tmp"
|
||||
Creating temporary file "C:\Users\dell\AppData\Local\Temp\RSP7BD4.tmp" with contents
|
||||
[
|
||||
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"Debug/" /Fp"Debug/contacts.pch" /Yc"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
|
||||
"G:\Contact\StdAfx.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\Users\dell\AppData\Local\Temp\RSP7BD4.tmp"
|
||||
Creating temporary file "C:\Users\dell\AppData\Local\Temp\RSP7BD5.tmp" with contents
|
||||
[
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/contacts.pdb" /debug /machine:I386 /out:"Debug/contacts.exe" /pdbtype:sept
|
||||
.\Debug\CheckInterface.obj
|
||||
.\Debug\Contact.obj
|
||||
.\Debug\ContactInterface.obj
|
||||
.\Debug\main.obj
|
||||
.\Debug\MainDelMenu.obj
|
||||
.\Debug\MainMdfMenu.obj
|
||||
.\Debug\MainNewMenu.obj
|
||||
.\Debug\MainStrategy.obj
|
||||
.\Debug\MainVewMenu.obj
|
||||
.\Debug\MainVewMenuInterface.obj
|
||||
.\Debug\Person.obj
|
||||
.\Debug\PrtMenuInterface.obj
|
||||
.\Debug\StdAfx.obj
|
||||
.\Debug\ViewAllMenu.obj
|
||||
.\Debug\ViewCategoryMenu.obj
|
||||
.\Debug\ViewExactMenu.obj
|
||||
.\Debug\ViewFuzzyMenu.obj
|
||||
.\Debug\ViewStrategy.obj
|
||||
]
|
||||
Creating command line "link.exe @C:\Users\dell\AppData\Local\Temp\RSP7BD5.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
StdAfx.cpp
|
||||
Compiling...
|
||||
CheckInterface.cpp
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\CheckInterface.cpp(12) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(61) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\CheckInterface.cpp(12) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(103) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\CheckInterface.cpp(12) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(105) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\CheckInterface.cpp(12) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(107) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\CheckInterface.cpp(12) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(108) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\CheckInterface.cpp(12) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
G:\Contact\CheckInterface.cpp(110) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
|
||||
G:\Contact\CheckInterface.cpp(110) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
|
||||
Contact.cpp
|
||||
ContactInterface.cpp
|
||||
main.cpp
|
||||
MainDelMenu.cpp
|
||||
MainMdfMenu.cpp
|
||||
MainNewMenu.cpp
|
||||
MainStrategy.cpp
|
||||
MainVewMenu.cpp
|
||||
MainVewMenuInterface.cpp
|
||||
Person.cpp
|
||||
PrtMenuInterface.cpp
|
||||
ViewAllMenu.cpp
|
||||
ViewCategoryMenu.cpp
|
||||
ViewExactMenu.cpp
|
||||
ViewFuzzyMenu.cpp
|
||||
ViewStrategy.cpp
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\ViewStrategy.cpp(65) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(61) : warning C4786: '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\ViewStrategy.cpp(65) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(103) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\ViewStrategy.cpp(65) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(105) : warning C4786: '?rbegin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\ViewStrategy.cpp(65) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(107) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE?AV?$reverse_iterator@PAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@AAV12@PAV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\ViewStrategy.cpp(65) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(108) : warning C4786: '?rend@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QBE?AV?$reverse_iterator@PBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@ABV12@PBV12@H@2@XZ' : identifier was truncated to '255' characters in the browser information
|
||||
G:\Contact\ViewStrategy.cpp(65) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
|
||||
G:\Contact\ViewStrategy.cpp(98) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
|
||||
G:\Contact\ViewStrategy.cpp(98) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
|
||||
Generating Code...
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(52) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
|
||||
d:\program files (x86)\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
|
||||
Linking...
|
||||
Creating temporary file "C:\Users\dell\AppData\Local\Temp\RSP8ACA.tmp" with contents
|
||||
[
|
||||
/nologo /o"Debug/contacts.bsc"
|
||||
.\Debug\StdAfx.sbr
|
||||
.\Debug\CheckInterface.sbr
|
||||
.\Debug\Contact.sbr
|
||||
.\Debug\ContactInterface.sbr
|
||||
.\Debug\main.sbr
|
||||
.\Debug\MainDelMenu.sbr
|
||||
.\Debug\MainMdfMenu.sbr
|
||||
.\Debug\MainNewMenu.sbr
|
||||
.\Debug\MainStrategy.sbr
|
||||
.\Debug\MainVewMenu.sbr
|
||||
.\Debug\MainVewMenuInterface.sbr
|
||||
.\Debug\Person.sbr
|
||||
.\Debug\PrtMenuInterface.sbr
|
||||
.\Debug\ViewAllMenu.sbr
|
||||
.\Debug\ViewCategoryMenu.sbr
|
||||
.\Debug\ViewExactMenu.sbr
|
||||
.\Debug\ViewFuzzyMenu.sbr
|
||||
.\Debug\ViewStrategy.sbr]
|
||||
Creating command line "bscmake.exe @C:\Users\dell\AppData\Local\Temp\RSP8ACA.tmp"
|
||||
Creating browse info file...
|
||||
<h3>Output Window</h3>
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
contacts.exe - 0 error(s), 21 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
|
||||
==========MAIN MENU===========
|
||||
|
|
||||
---New___1-------------------
|
||||
|
|
||||
---Delete_2------------------
|
||||
|
|
||||
---Modify_3------------------
|
||||
|
|
||||
---View___4------------------
|
||||
|
|
||||
---Quit___5------------------
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
|
||||
|
||||
====Options=======
|
||||
|
|
||||
-------Delete_1---
|
||||
|
|
||||
-------Modify_2---
|
||||
|
|
||||
-------Back___3---
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
==========VIEW CONTACT========
|
||||
|
|
||||
---********------------------
|
||||
|
|
||||
---********------------------
|
||||
|
|
||||
---********------------------
|
||||
|
|
||||
---View___*------------------
|
||||
| |
|
||||
-----Exact query__1-------
|
||||
| |
|
||||
-----Fuzzy query__2-------
|
||||
| |
|
||||
-----Category_____3-------
|
||||
| |
|
||||
-----All__________4-------
|
||||
| |
|
||||
-----Back_________5-------
|
||||
|
|
||||
---********------------------
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
========Program Entry========
|
||||
Author: Ñ϶÷ΰ
|
||||
Version: 1.2
|
||||
Submit Date: 18.06.20
|
||||
=========================
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Contact.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Contact* my_contact = new Contact();
|
||||
ContactInterface* my_interface = my_contact;
|
||||
ContactInit* my_init = my_contact;
|
||||
my_init->welcome();
|
||||
|
||||
while(1){
|
||||
my_init->refresh();
|
||||
if (my_interface->main_menu() == -1)
|
||||
break;
|
||||
}
|
||||
delete my_contact;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
#MakeFile created by automake-OvenVan
|
||||
|
||||
BIN = contact.exe
|
||||
CC = gcc
|
||||
CFLAG = -g3 -Wall -static-libgcc =std=c++11
|
||||
CXX = g++
|
||||
CXXFLAG = -g3 -Wall -static-libgcc -std=c++11 -lstdc++
|
||||
OBJ = CheckInterface.o Contact.o ContactInterface.o MainDelMenu.o MainMdfMenu.o MainNewMenu.o MainStrategy.o MainTestMenu.o MainVewMenu.o MainVewMenuInterface.o Person.o PrtMenuInterface.o StdAfx.o ViewAllMenu.o ViewCategoryMenu.o ViewExactMenu.o ViewFuzzyMenu.o ViewStrategy.o main.o
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CXX) $(OBJ) -o $(BIN)
|
||||
|
||||
CheckInterface.o: CheckInterface.cpp
|
||||
$(CC) -c CheckInterface.cpp -o CheckInterface.o $(CXXFLAG)
|
||||
|
||||
Contact.o: Contact.cpp
|
||||
$(CC) -c Contact.cpp -o Contact.o $(CXXFLAG)
|
||||
|
||||
ContactInterface.o: ContactInterface.cpp
|
||||
$(CC) -c ContactInterface.cpp -o ContactInterface.o $(CXXFLAG)
|
||||
|
||||
MainDelMenu.o: MainDelMenu.cpp
|
||||
$(CC) -c MainDelMenu.cpp -o MainDelMenu.o $(CXXFLAG)
|
||||
|
||||
MainMdfMenu.o: MainMdfMenu.cpp
|
||||
$(CC) -c MainMdfMenu.cpp -o MainMdfMenu.o $(CXXFLAG)
|
||||
|
||||
MainNewMenu.o: MainNewMenu.cpp
|
||||
$(CC) -c MainNewMenu.cpp -o MainNewMenu.o $(CXXFLAG)
|
||||
|
||||
MainStrategy.o: MainStrategy.cpp
|
||||
$(CC) -c MainStrategy.cpp -o MainStrategy.o $(CXXFLAG)
|
||||
|
||||
MainTestMenu.o: MainTestMenu.cpp
|
||||
$(CC) -c MainTestMenu.cpp -o MainTestMenu.o $(CXXFLAG)
|
||||
|
||||
MainVewMenu.o: MainVewMenu.cpp
|
||||
$(CC) -c MainVewMenu.cpp -o MainVewMenu.o $(CXXFLAG)
|
||||
|
||||
MainVewMenuInterface.o: MainVewMenuInterface.cpp
|
||||
$(CC) -c MainVewMenuInterface.cpp -o MainVewMenuInterface.o $(CXXFLAG)
|
||||
|
||||
Person.o: Person.cpp
|
||||
$(CC) -c Person.cpp -o Person.o $(CXXFLAG)
|
||||
|
||||
PrtMenuInterface.o: PrtMenuInterface.cpp
|
||||
$(CC) -c PrtMenuInterface.cpp -o PrtMenuInterface.o $(CXXFLAG)
|
||||
|
||||
StdAfx.o: StdAfx.cpp
|
||||
$(CC) -c StdAfx.cpp -o StdAfx.o $(CXXFLAG)
|
||||
|
||||
ViewAllMenu.o: ViewAllMenu.cpp
|
||||
$(CC) -c ViewAllMenu.cpp -o ViewAllMenu.o $(CXXFLAG)
|
||||
|
||||
ViewCategoryMenu.o: ViewCategoryMenu.cpp
|
||||
$(CC) -c ViewCategoryMenu.cpp -o ViewCategoryMenu.o $(CXXFLAG)
|
||||
|
||||
ViewExactMenu.o: ViewExactMenu.cpp
|
||||
$(CC) -c ViewExactMenu.cpp -o ViewExactMenu.o $(CXXFLAG)
|
||||
|
||||
ViewFuzzyMenu.o: ViewFuzzyMenu.cpp
|
||||
$(CC) -c ViewFuzzyMenu.cpp -o ViewFuzzyMenu.o $(CXXFLAG)
|
||||
|
||||
ViewStrategy.o: ViewStrategy.cpp
|
||||
$(CC) -c ViewStrategy.cpp -o ViewStrategy.o $(CXXFLAG)
|
||||
|
||||
main.o: main.cpp
|
||||
$(CC) -c main.cpp -o main.o $(CXXFLAG)
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// contacts.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "Contact.h"
|
||||
#include "Person.h"
|
||||
|
||||
vector<Person*> contact_item;
|
||||
string errorMsg;
|
|
@ -1,18 +0,0 @@
|
|||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__F5925CEB_85C9_4293_8D63_288D374D3EDC__INCLUDED_)
|
||||
#define AFX_STDAFX_H__F5925CEB_85C9_4293_8D63_288D374D3EDC__INCLUDED_
|
||||
|
||||
#include <io.h>
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <conio.h>
|
||||
using namespace std;
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__F5925CEB_85C9_4293_8D63_288D374D3EDC__INCLUDED_)
|
Loading…
Reference in New Issue