3 //=============================================================================
7 * @author Gerhard Lenzer
9 //=============================================================================
13 #include /**/ "ace/pre.h"
15 #include "ace/IO_SAP.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/FILE_Addr.h"
23 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 * @class ACE_FILE_Info
28 * @brief Abstracts basic OS FILE information.
30 class ACE_Export ACE_FILE_Info
46 * @brief Defines the core methods of the ACE_FILE abstraction.
48 class ACE_Export ACE_FILE
: public ACE_IO_SAP
51 /// Close the ACE_FILE handle without removing the ACE_FILE from
55 /// Close and remove the ACE_FILE from the file system.
58 /// Remove the ACE_FILE from the file system without closing the
62 /// Get information on this ACE_FILE.
63 int get_info (ACE_FILE_Info
*finfo
);
65 /// Get information on this ACE_FILE.
66 int get_info (ACE_FILE_Info
&finfo
);
68 /// Set filesize to length byte.
69 int truncate (ACE_OFF_T length
);
72 * Sets the file pointer as follows:
73 * o If @ whence is @c SEEK_SET, the pointer is set to @a offset
76 * o If @a whence> is @c SEEK_CUR, the pointer is set to its
77 * current location plus @a offset.
79 * o If @a whence is @c SEEK_END, the pointer is set to the size
80 * of the file plus offset.
82 ACE_OFF_T
seek (ACE_OFF_T offset
,
83 int whence
= SEEK_CUR
);
85 /// Return an offset for the file handle.
86 ACE_OFF_T
tell (void);
89 * Disable signal @a signum
90 * This is here to prevent Win32 from
91 * disabling SPIPE using socket calls
93 int disable (int signum
) const ;
95 /// Return the local endpoint address in the referenced ACE_Addr.
96 /// Returns 0 if successful, else -1.
97 int get_local_addr (ACE_Addr
&) const;
99 /// Return the same thing as get_local_addr().
100 int get_remote_addr (ACE_Addr
&) const;
102 /// Dump the state of an object.
103 void dump (void) const;
105 /// Declare the dynamic allocation hooks.
106 ACE_ALLOC_HOOK_DECLARE
;
109 /// Ensure that this class is only created by the
110 /// ACE_FILE_Connector.
113 /// File we are "connected" with...
117 ACE_END_VERSIONED_NAMESPACE_DECL
119 #if defined (__ACE_INLINE__)
120 #include "ace/FILE.inl"
121 #endif /* __ACE_INLINE__ */
123 #include /**/ "ace/post.h"
124 #endif /* ACE_FILE_H */