| 28 | */ |
| 29 | |
| 30 | class FileLock { |
| 31 | protected: |
| 32 | /*! |
| 33 | *\brief �����fd. |
| 34 | */ |
| 35 | int m_iFd; |
| 36 | |
| 37 | protected: |
| 38 | |
| 39 | /*! |
| 40 | *\brief ��fcntl�ķ�װ. |
| 41 | *\param iCmd int ,�����֣���μ�man fcntl. |
| 42 | *\param iType int ,�����ͣ���μ�man fcntl. |
| 43 | *\param iOffset int ,���iWhere�ļ���ƫ����. |
| 44 | *\param iLen int ,��ס���ֽ���. |
| 45 | *\param iWhere int ,����λ�ã�SEEK_XXX. |
| 46 | *\retval true:�ɹ���false:ʧ��. |
| 47 | * |
| 48 | */ |
| 49 | bool Fcntl(int iCmd, int iType, int iOffset, int iLen, int iWhence); |
| 50 | |
| 51 | /*! |
| 52 | *\brief ��fcntl�ķ�װ������ָ��ʱ�仹δȡ��������ʱ����ʧ�ܣ�ǰ��5�������μ�ǰ��. |
| 53 | *\param sec int ,ָ��ʱ��s. |
| 54 | * |
| 55 | */ |
| 56 | bool FcntlTimeOut(int iCmd, int iType, int iOffset, int iLen, int iWhence, int sec); |
| 57 | |
| 58 | /*! |
| 59 | * |
| 60 | *\brief Fcntl()���ļ��汾. |
| 61 | * |
| 62 | */ |
| 63 | bool Fcntl(int iCmd, int iType, uint64_t iOffset, uint64_t iLen, int iWhence); |
| 64 | |
| 65 | /*! |
| 66 | * |
| 67 | *\brief FcntlTimeOut()���ļ��汾. |
| 68 | * |
| 69 | */ |
| 70 | bool FcntlTimeOut(int iCmd, int iType, uint64_t iOffset, uint64_t iLen, int iWhence, int sec); |
| 71 | public: |
| 72 | |
| 73 | /*! |
| 74 | *\brief ���캯��. |
| 75 | * |
| 76 | */ |
| 77 | FileLock(); |
| 78 | |
| 79 | /*! |
| 80 | *\brief �����������رմ��ļ�������. |
| 81 | * |
| 82 | */ |
| 83 | virtual ~FileLock(); |
| 84 | |
| 85 | /*! |
| 86 | *\brief ʹ��һ��ָ�����ļ���. |
| 87 | *\param sPath const char *,�ļ���·��. |
nothing calls this directly
no outgoing calls
no test coverage detected