obexsender.hh

来自「It s a tool designed to extract as much 」· HH 代码 · 共 104 行

HH
104
字号
/* -*- c++ -*- ---------------------------------------------------------------   Copyright (C) 2005, SWECO, All Rights Reserved.   OBEX message sender implementation, based on Pontus Fuchs's obex code   <pontus.fuchs@tactel.se>   $Id$   Author: Zsolt Molnar (Zsolt.Molnar@ieee.org)   ---------------------------------------------------------------------------*/#ifndef __OBEXSENDER_HH__#define __OBEXSENDER_HH__#include <pthread.h>#include <map>#include "base.hh"#include "IError.hh"#include "IOBEXSender.hh"#define OS_BUSY_WAIT_TIME 1   // second#ifdef _cplusplusextern "C" {#endifclass OBEXSender : virtual public IOBEXSender {public:	typedef map<pthread_t, int> _tErrMap;	static _tErrMap _errMap;public:	OBEXSender();	virtual ~OBEXSender() {};	virtual tSendState send(const string& aFileName, const string& aTitle);	virtual void setPort(const string& aPort) {_port = aPort;};private:	string _port;	static pthread_mutex_t _mapMutex;	static bool _isInit;	#ifdef __TEST__public:		bool test(const Device& dev);#endif // #ifdef __TEST__};// Errors// No target device setclass OBEXSender_NoTargetError : virtual public IError {public:		OBEXSender_NoTargetError() {};	virtual ~OBEXSender_NoTargetError() {};	virtual void print(ostream& aStream) 		{			aStream << "OBEXSender: no push target device set";		};		virtual tType getType() {return FATAL;};};// File not foundclass OBEXSender_NoFileError : virtual public IError {public:		OBEXSender_NoFileError(const string& aFileName) : _fname(aFileName) {};	virtual ~OBEXSender_NoFileError() {};	virtual void print(ostream& aStream) 		{			aStream << "OBEXSender: Message file \"" << _fname 					<< "\" is not found";		};		virtual tType getType() {return RECOVERABLE;};private:	string _fname;};#ifdef _cplusplus}#endifextern "C" {    // For error related communication with obex_socket	int* __eebt_getErrLocation(const pthread_t aThread);}#endif /* #ifndef __OBEXSENDER_HH__ */   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?