本文整理汇总了C++中DataManager::setPasscode方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::setPasscode方法的具体用法?C++ DataManager::setPasscode怎么用?C++ DataManager::setPasscode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::setPasscode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
DataManager* data = DataManager::instanceOf();
if(argc >=2)
{
if(strcmp(argv[1],"-o")==0)
{
string file_name(argv[2]);
data->loadFile(file_name);
}
}
string input;
do
{
cout << endl;
if(data->getList().size() > 0)
{
data->getList().getTaskList();
cout << endl;
}
cout << "opcje do wyboru:" << endl;
cout << "open" << endl;
cout << "create" << endl;
cout << "exit" << endl;
if(data->getList().size() > 0)
{
cout << "save" << endl;
cout << "setdate" << endl;
cout << "settime" << endl;
cout << "setdescription" << endl;
cout << "settitle" << endl;
cout << "setpriority" << endl;
cout << "setseverity" << endl;
}
cout << endl << "->";
getline(cin,input);
if(input == "open")
{
getline(cin,input);
data->loadFile(input);
if(data->auth_required())
{
for(int i = 0; i < 3; ++i)
{
cout << "password:" << endl;
getline(cin,input);
if(data->auth(input))
cout << "Welcome" << endl;
else
cout << "access danied" << endl;
input = "";
}
continue;
}
}
int i = 0;
if(input == "save")
{
cout << "Podaj nazwe pliku:" << endl;
getline(cin,input);
if( data->saveToFile(input) )
{
cout << "Zapisano" << endl;
}
else
{
cerr << "Nie udało się zapisać" << endl;
}
}
string tmp;
if(input == "create")
{
cout << "podaj tytul" << endl;
getline(cin,tmp);
int id = data->addTask(tmp);
data->getList();
set_date(id);
set_time(id);
}
if(input == "setpass")
{
bool fine = true;
string opass, npass;
if(data->auth_required())
{
cout << "podaj aktualne haslo:" << endl;
getline(cin,opass);
fine = data->auth(opass);
if(!fine)
cout << "haslo nieprawidlowe" << endl;
}
if(fine)
{
cout << "podaj nowe haslo" << endl;
getline(cin,npass);
data->setPasscode(opass,npass);
}
//.........这里部分代码省略.........