#include <FILE.h>
Inheritance diagram for ACE_FILE:


Public Member Functions | |
| int | close (void) |
| int | remove (void) |
| Close and remove the ACE_FILE from the file system. | |
| int | unlink (void) |
| int | get_info (ACE_FILE_Info *finfo) |
| Get information on this ACE_FILE. | |
| int | get_info (ACE_FILE_Info &finfo) |
| Get information on this . | |
| int | truncate (off_t length) |
| Set filesize to length byte. | |
| off_t | seek (off_t offset, int whence=SEEK_CUR) |
| off_t | tell (void) |
| Return an offset for the file handle. | |
| int | disable (int signum) const |
| int | get_local_addr (ACE_Addr &) const |
| int | get_remote_addr (ACE_Addr &) const |
| Return the same thing as get_local_addr(). | |
| void | dump (void) const |
| Dump the state of an object. | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
Protected Member Functions | |
| ACE_FILE (void) | |
Protected Attributes | |
| ACE_FILE_Addr | addr_ |
| File we are "connected" with... | |
Definition at line 63 of file FILE.h.
|
|
Ensure that this class is only created by the ACE_FILE_Connector. Definition at line 33 of file FILE.cpp. References ACE_TRACE.
00034 {
00035 ACE_TRACE ("ACE_FILE::ACE_FILE");
00036 }
|
|
|
Close the ACE_FILE handle without removing the ACE_FILE from the file system. Definition at line 41 of file FILE.cpp. References ACE_TRACE, ACE_OS::close(), ACE_IO_SAP::get_handle(), and ACE_IO_SAP::set_handle(). Referenced by remove().
00042 {
00043 ACE_TRACE ("ACE_FILE::close");
00044 int result = 0;
00045
00046 if (this->get_handle () != ACE_INVALID_HANDLE)
00047 {
00048 result = ACE_OS::close (this->get_handle ());
00049 this->set_handle (ACE_INVALID_HANDLE);
00050 }
00051 return result;
00052 }
|
|
|
Disable signal signum This is here to prevent Win32 from disabling SPIPE using socket calls Reimplemented from ACE_IO_SAP. Definition at line 8 of file FILE.inl. References ACE_IO_SAP::disable().
00009 {
00010 #if defined (ACE_WIN32)
00011 ACE_UNUSED_ARG (signum) ;
00012 return 0 ;
00013 #else /* ACE_WIN32 */
00014 return ACE_IO_SAP::disable (signum) ;
00015 #endif /* ACE_WIN32 */
00016 }
|
|
|
Dump the state of an object.
Reimplemented from ACE_IO_SAP. Reimplemented in ACE_FILE_IO. Definition at line 23 of file FILE.cpp. References ACE_TRACE, and ACE_IO_SAP::dump().
00024 {
00025 #if defined (ACE_HAS_DUMP)
00026 ACE_TRACE ("ACE_FILE::dump");
00027 ACE_IO_SAP::dump ();
00028 #endif /* ACE_HAS_DUMP */
00029 }
|
|
|
Get information on this .
Definition at line 74 of file FILE.cpp. References ACE_TRACE, and get_info().
|
|
|
Get information on this ACE_FILE.
Definition at line 55 of file FILE.cpp. References ACE_stat, ACE_TRACE, ACE_OS::fstat(), ACE_FILE_Info::mode_, ACE_FILE_Info::nlink_, and ACE_FILE_Info::size_. Referenced by get_info().
00056 {
00057 ACE_TRACE ("ACE_FILE::get_info");
00058 ACE_stat filestatus;
00059
00060 int const result = ACE_OS::fstat (this->get_handle (),
00061 &filestatus);
00062
00063 if (result == 0)
00064 {
00065 finfo->mode_ = filestatus.st_mode;
00066 finfo->nlink_ = filestatus.st_nlink;
00067 finfo->size_ = filestatus.st_size;
00068 }
00069
00070 return result;
00071 }
|
|
|
Return the local endpoint address in the referenced ACE_Addr. Returns 0 if successful, else -1. Definition at line 106 of file FILE.cpp. References ACE_TRACE. Referenced by get_remote_addr().
00107 {
00108 ACE_TRACE ("ACE_FILE::get_local_addr");
00109
00110 // Perform the downcast since <addr> had better be an
00111 // <ACE_FILE_Addr>.
00112 ACE_FILE_Addr *file_addr =
00113 dynamic_cast<ACE_FILE_Addr *> (&addr);
00114
00115 if (file_addr == 0)
00116 return -1;
00117 else
00118 {
00119 *file_addr = this->addr_;
00120 return 0;
00121 }
00122 }
|
|
|
Return the same thing as get_local_addr().
Definition at line 127 of file FILE.cpp. References ACE_TRACE, and get_local_addr().
00128 {
00129 ACE_TRACE ("ACE_FILE::get_remote_addr");
00130
00131 return this->get_local_addr (addr);
00132 }
|
|
|
Close and remove the ACE_FILE from the file system.
Definition at line 135 of file FILE.cpp. References ACE_TRACE, close(), and ACE_OS::unlink().
00136 {
00137 ACE_TRACE ("ACE_FILE::remove");
00138
00139 this->close ();
00140 return ACE_OS::unlink (this->addr_.get_path_name ());
00141 }
|
|
||||||||||||
|
Sets the file pointer as follows: o If is , the pointer is set to bytes. o If is , the pointer is set to its current location plus . o If is , the pointer is set to the size of the file plus offset. Definition at line 89 of file FILE.cpp. References ACE_OS::lseek().
00090 {
00091 return ACE_OS::lseek (this->get_handle (),
00092 offset,
00093 startpos);
00094 }
|
|
|
Return an offset for the file handle.
Definition at line 97 of file FILE.cpp. References ACE_TRACE, and ACE_OS::lseek().
00098 {
00099 ACE_TRACE ("ACE_FILE::tell");
00100 return ACE_OS::lseek (this->get_handle (), 0, SEEK_CUR);
00101 }
|
|
|
Set filesize to length byte.
Definition at line 82 of file FILE.cpp. References ACE_TRACE, and ACE_OS::ftruncate().
00083 {
00084 ACE_TRACE ("ACE_FILE::truncate");
00085 return ACE_OS::ftruncate (this->get_handle(), length);
00086 }
|
|
|
Remove the ACE_FILE from the file system without closing the ACE_FILE handle. Definition at line 144 of file FILE.cpp. References ACE_TRACE, and ACE_OS::unlink().
00145 {
00146 ACE_TRACE ("ACE_FILE::unlink");
00147
00148 return ACE_OS::unlink (this->addr_.get_path_name ());
00149 }
|
|
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_IO_SAP. Reimplemented in ACE_FILE_IO. |
|
|
File we are "connected" with...
Definition at line 129 of file FILE.h. Referenced by ACE_FILE_Connector::connect(). |
1.3.6