📄 main.cpp
字号:
/* -*- c++ -*- --------------------------------------------------------------- Copyright (C) 2005, zsoltmolnar.hu, All Rights Reserved. Starting point of the BlueScan application Author: Zsolt Molnar (Zsolt.Molnar@ieee.org) ---------------------------------------------------------------------------*/#include <memory>#include <sstream>#include <fstream>#include <iostream>#include <errno.h> #include "IDeviceRecovery.hh"#include "IDeviceManager.hh"#include "IError.hh"#include "AppFactory.hh"namespace { const char rcs_id[] = "$Id$"; }using namespace std;int main(int argc, char** argv) { /* Store the kill info... */ stringstream killFileName; killFileName << "kill_btappserv.sh"; ofstream killFile(killFileName.str().c_str()); if (!killFile) { cout << "Unable to store kill info, kill " << argv[0] << " manually. " << strerror(errno) << endl; } else { killFile << "kill -9 " << getpid() << endl; killFile.close(); } AppFactory::setup(); auto_ptr<IDeviceManager> devManager(AppFactory::newDeviceManagerC()); auto_ptr<IDeviceRecovery> devRecovery(AppFactory::newDeviceRecoveryC(*devManager)); while(1) { try { devRecovery->start(); } catch(IError& error) { cerr << "ERROR: "; error.print(cerr); cerr << endl; if (error.getType() == IError::FATAL) { exit(-1); } } } AppFactory::cleanup(); return 1;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -