Ticket #8008: BNode_remove_documentation_from_source.diff

File BNode_remove_documentation_from_source.diff, 20.1 KB (added by jscipione, 13 years ago)

Patch that removes the documenation from the Node.cpp and Node.h files.

  • headers/os/storage/Node.h

    diff --git headers/os/storage/Node.h headers/os/storage/Node.h
    index 06f8ed4..bb22e74 100644
    class BString;  
    1414struct entry_ref;
    1515
    1616
    17 //! Reference structure to a particular vnode on a particular device
    18 /*! <b>node_ref</b> - A node reference.
    19 
    20     @author <a href="mailto:tylerdauwalder@users.sf.net">Tyler Dauwalder</a>
    21     @author Be Inc.
    22     @version 0.0.0
    23 */
    2417struct node_ref {
    2518    node_ref();
    2619    node_ref(const node_ref &ref);
    struct node_ref {  
    3427};
    3528
    3629
    37 //! A BNode represents a chunk of data in the filesystem.
    38 /*! The BNode class provides an interface for manipulating the data and attributes
    39     belonging to filesystem entries. The BNode is unaware of the name that refers
    40     to it in the filesystem (i.e. its entry); a BNode is solely concerned with
    41     the entry's data and attributes.
    42 
    43 
    44     @author <a href='mailto:tylerdauwalder@users.sf.net'>Tyler Dauwalder</a>
    45     @version 0.0.0
    46 
    47 */
    4830class BNode : public BStatable {
    4931public:
    5032    BNode();
  • src/kits/storage/Node.cpp

    diff --git src/kits/storage/Node.cpp src/kits/storage/Node.cpp
    index 0def72e..1fc1fa7 100644
     
    88 */
    99
    1010
    11 /*!
    12     \file Node.cpp
    13     BNode implementation.
    14 */
    15 
    1611#include <Node.h>
    1712
    1813#include <errno.h>
     
    3732//  #pragma mark - node_ref
    3833
    3934
    40 /*! \brief Creates an uninitialized node_ref object.
    41 */
    4235node_ref::node_ref()
    4336        : device((dev_t)-1),
    4437          node((ino_t)-1)
    node_ref::node_ref()  
    4639}
    4740
    4841// copy constructor
    49 /*! \brief Creates a copy of the given node_ref object.
    50     \param ref the node_ref to be copied
    51 */
    5242node_ref::node_ref(const node_ref &ref)
    5343        : device((dev_t)-1),
    5444          node((ino_t)-1)
    node_ref::node_ref(const node_ref &ref)  
    5747}
    5848
    5949// ==
    60 /*! \brief Tests whether this node_ref and the supplied one are equal.
    61     \param ref the node_ref to be compared with
    62     \return \c true, if the objects are equal, \c false otherwise
    63 */
    6450bool
    6551node_ref::operator==(const node_ref &ref) const
    6652{
    node_ref::operator==(const node_ref &ref) const  
    6854}
    6955
    7056// !=
    71 /*! \brief Tests whether this node_ref and the supplied one are not equal.
    72     \param ref the node_ref to be compared with
    73     \return \c false, if the objects are equal, \c true otherwise
    74 */
    7557bool
    7658node_ref::operator!=(const node_ref &ref) const
    7759{
    node_ref::operator!=(const node_ref &ref) const  
    7961}
    8062
    8163// =
    82 /*! \brief Makes this node ref a copy of the supplied one.
    83     \param ref the node_ref to be copied
    84     \return a reference to this object
    85 */
    8664node_ref&
    8765node_ref::operator=(const node_ref &ref)
    8866{
    node_ref::operator=(const node_ref &ref)  
    9573//  #pragma mark - BNode
    9674
    9775
    98 /*! \brief Creates an uninitialized BNode object
    99 */
    10076BNode::BNode()
    10177     : fFd(-1),
    10278       fAttrFd(-1),
    BNode::BNode()  
    10581}
    10682
    10783
    108 /*! \brief Creates a BNode object and initializes it to the specified
    109     entry_ref.
    110     \param ref the entry_ref referring to the entry
    111 */
    11284BNode::BNode(const entry_ref *ref)
    11385     : fFd(-1),
    11486       fAttrFd(-1),
    BNode::BNode(const entry_ref *ref)  
    11890}
    11991
    12092
    121 /*! \brief Creates a BNode object and initializes it to the specified
    122     filesystem entry.
    123     \param entry the BEntry representing the entry
    124 */
    12593BNode::BNode(const BEntry *entry)
    12694     : fFd(-1),
    12795       fAttrFd(-1),
    BNode::BNode(const BEntry *entry)  
    13199}
    132100
    133101
    134 /*! \brief Creates a BNode object and initializes it to the entry referred
    135     to by the specified path.
    136     \param path the path referring to the entry
    137 */
    138102BNode::BNode(const char *path)
    139103     : fFd(-1),
    140104       fAttrFd(-1),
    BNode::BNode(const char *path)  
    144108}
    145109
    146110
    147 /*! \brief Creates a BNode object and initializes it to the entry referred
    148     to by the specified path rooted in the specified directory.
    149     \param dir the BDirectory, relative to which the entry's path name is
    150            given
    151     \param path the entry's path name relative to \a dir
    152 */
    153111BNode::BNode(const BDirectory *dir, const char *path)
    154112     : fFd(-1),
    155113       fAttrFd(-1),
    BNode::BNode(const BDirectory *dir, const char *path)  
    159117}
    160118
    161119
    162 /*! \brief Creates a copy of the given BNode.
    163     \param node the BNode to be copied
    164 */
    165120BNode::BNode(const BNode &node)
    166121     : fFd(-1),
    167122       fAttrFd(-1),
    BNode::BNode(const BNode &node)  
    171126}
    172127
    173128
    174 /*! \brief Frees all resources associated with the BNode.
    175 */
    176129BNode::~BNode()
    177130{
    178131    Unset();
    179132}
    180133
    181134
    182 /*! \brief Checks whether the object has been properly initialized or not.
    183     \return
    184     - \c B_OK, if the object has been properly initialized,
    185     - an error code, otherwise.
    186 */
    187135status_t
    188136BNode::InitCheck() const
    189137{
    BNode::InitCheck() const  
    191139}
    192140
    193141
    194 /*! \fn status_t BNode::GetStat(struct stat *st) const
    195     \brief Fills in the given stat structure with \code stat() \endcode
    196            information for this object.
    197     \param st a pointer to a stat structure to be filled in
    198     \return
    199     - \c B_OK: Everything went fine.
    200     - \c B_BAD_VALUE: \c NULL \a st.
    201     - another error code, e.g., if the object wasn't properly initialized
    202 */
    203 
    204 
    205 /*! \brief Reinitializes the object to the specified entry_ref.
    206     \param ref the entry_ref referring to the entry
    207     \return
    208     - \c B_OK: Everything went fine.
    209     - \c B_BAD_VALUE: \c NULL \a ref.
    210     - \c B_ENTRY_NOT_FOUND: The entry could not be found.
    211     - \c B_BUSY: The entry is locked.
    212 */
    213142status_t
    214143BNode::SetTo(const entry_ref *ref)
    215144{
    BNode::SetTo(const entry_ref *ref)  
    217146}
    218147
    219148
    220 /*! \brief Reinitializes the object to the specified filesystem entry.
    221     \param entry the BEntry representing the entry
    222     \return
    223     - \c B_OK: Everything went fine.
    224     - \c B_BAD_VALUE: \c NULL \a entry.
    225     - \c B_ENTRY_NOT_FOUND: The entry could not be found.
    226     - \c B_BUSY: The entry is locked.
    227 */
    228149status_t
    229150BNode::SetTo(const BEntry *entry)
    230151{
    BNode::SetTo(const BEntry *entry)  
    236157}
    237158
    238159
    239 /*! \brief Reinitializes the object to the entry referred to by the specified
    240            path.
    241     \param path the path referring to the entry
    242     \return
    243     - \c B_OK: Everything went fine.
    244     - \c B_BAD_VALUE: \c NULL \a path.
    245     - \c B_ENTRY_NOT_FOUND: The entry could not be found.
    246     - \c B_BUSY: The entry is locked.
    247 */
    248160status_t
    249161BNode::SetTo(const char *path)
    250162{
    BNode::SetTo(const char *path)  
    252164}
    253165
    254166
    255 /*! \brief Reinitializes the object to the entry referred to by the specified
    256     path rooted in the specified directory.
    257     \param dir the BDirectory, relative to which the entry's path name is
    258            given
    259     \param path the entry's path name relative to \a dir
    260     \return
    261     - \c B_OK: Everything went fine.
    262     - \c B_BAD_VALUE: \c NULL \a dir or \a path.
    263     - \c B_ENTRY_NOT_FOUND: The entry could not be found.
    264     - \c B_BUSY: The entry is locked.
    265 */
    266167status_t
    267168BNode::SetTo(const BDirectory *dir, const char *path)
    268169{
    BNode::SetTo(const BDirectory *dir, const char *path)  
    274175}
    275176
    276177
    277 /*! \brief Returns the object to an uninitialized state.
    278 */
    279178void
    280179BNode::Unset()
    281180{
    BNode::Unset()  
    284183}
    285184
    286185
    287 /*! \brief Attains an exclusive lock on the data referred to by this node, so
    288     that it may not be modified by any other objects or methods.
    289     \return
    290     - \c B_OK: Everything went fine.
    291     - \c B_FILE_ERROR: The object is not initialized.
    292     - \c B_BUSY: The node is already locked.
    293 */
    294186status_t
    295187BNode::Lock()
    296188{
    BNode::Lock()  
    300192}
    301193
    302194
    303 /*! \brief Unlocks the node.
    304     \return
    305     - \c B_OK: Everything went fine.
    306     - \c B_FILE_ERROR: The object is not initialized.
    307     - \c B_BAD_VALUE: The node is not locked.
    308 */
    309195status_t
    310196BNode::Unlock()
    311197{
    BNode::Unlock()  
    315201}
    316202
    317203
    318 /*! \brief Immediately performs any pending disk actions on the node.
    319     \return
    320     - \c B_OK: Everything went fine.
    321     - an error code, if something went wrong.
    322 */
    323204status_t
    324205BNode::Sync()
    325206{
    BNode::Sync()  
    327208}
    328209
    329210
    330 /*! \brief Writes data from a buffer to an attribute.
    331     Write the \a len bytes of data from \a buffer to
    332     the attribute specified by \a name after erasing any data
    333     that existed previously. The type specified by \a type \em is
    334     remembered, and may be queried with GetAttrInfo(). The value of
    335     \a offset is currently ignored.
    336     \param attr the name of the attribute
    337     \param type the type of the attribute
    338     \param offset the index at which to write the data (currently ignored)
    339     \param buffer the buffer containing the data to be written
    340     \param len the number of bytes to be written
    341     \return
    342     - the number of bytes actually written
    343     - \c B_BAD_VALUE: \c NULL \a attr or \a buffer
    344     - \c B_FILE_ERROR: The object is not initialized or the node it refers to
    345       is read only.
    346     - \c B_NOT_ALLOWED: The node resides on a read only volume.
    347     - \c B_DEVICE_FULL: Insufficient disk space.
    348     - \c B_NO_MEMORY: Insufficient memory to complete the operation.
    349 */
    350211ssize_t
    351212BNode::WriteAttr(const char *attr, type_code type, off_t offset,
    352213                 const void *buffer, size_t len)
    BNode::WriteAttr(const char *attr, type_code type, off_t offset,  
    361222}
    362223
    363224
    364 /*! \brief Reads data from an attribute into a buffer.
    365     Reads the data of the attribute given by \a name into
    366     the buffer specified by \a buffer with length specified
    367     by \a len. \a type and \a offset are currently ignored.
    368     \param attr the name of the attribute
    369     \param type the type of the attribute (currently ignored)
    370     \param offset the index from which to read the data (currently ignored)
    371     \param buffer the buffer for the data to be read
    372     \param len the number of bytes to be read
    373     \return
    374     - the number of bytes actually read
    375     - \c B_BAD_VALUE: \c NULL \a attr or \a buffer
    376     - \c B_FILE_ERROR: The object is not initialized.
    377     - \c B_ENTRY_NOT_FOUND: The node has no attribute \a attr.
    378 */
    379225ssize_t
    380226BNode::ReadAttr(const char *attr, type_code type, off_t offset,
    381227                void *buffer, size_t len) const
    BNode::ReadAttr(const char *attr, type_code type, off_t offset,  
    390236}
    391237
    392238
    393 /*! \brief Deletes the attribute given by \a name.
    394     \param name the name of the attribute
    395     - \c B_OK: Everything went fine.
    396     - \c B_BAD_VALUE: \c NULL \a name
    397     - \c B_FILE_ERROR: The object is not initialized or the node it refers to
    398       is read only.
    399     - \c B_ENTRY_NOT_FOUND: The node has no attribute \a name.
    400     - \c B_NOT_ALLOWED: The node resides on a read only volume.
    401 */
    402239status_t
    403240BNode::RemoveAttr(const char *name)
    404241{
    BNode::RemoveAttr(const char *name)  
    406243}
    407244
    408245
    409 /*! \brief Moves the attribute given by \a oldname to \a newname.
    410     If \a newname already exists, the current data is clobbered.
    411     \param oldname the name of the attribute to be renamed
    412     \param newname the new name for the attribute
    413     \return
    414     - \c B_OK: Everything went fine.
    415     - \c B_BAD_VALUE: \c NULL \a oldname or \a newname
    416     - \c B_FILE_ERROR: The object is not initialized or the node it refers to
    417       is read only.
    418     - \c B_ENTRY_NOT_FOUND: The node has no attribute \a oldname.
    419     - \c B_NOT_ALLOWED: The node resides on a read only volume.
    420 */
    421246status_t
    422247BNode::RenameAttr(const char *oldname, const char *newname)
    423248{
    BNode::RenameAttr(const char *oldname, const char *newname)  
    428253}
    429254
    430255
    431 /*! \brief Fills in the pre-allocated attr_info struct pointed to by \a info
    432     with useful information about the attribute specified by \a name.
    433     \param name the name of the attribute
    434     \param info the attr_info structure to be filled in
    435     \return
    436     - \c B_OK: Everything went fine.
    437     - \c B_BAD_VALUE: \c NULL \a name
    438     - \c B_FILE_ERROR: The object is not initialized.
    439     - \c B_ENTRY_NOT_FOUND: The node has no attribute \a name.
    440 */
    441256status_t
    442257BNode::GetAttrInfo(const char *name, struct attr_info *info) const
    443258{
    BNode::GetAttrInfo(const char *name, struct attr_info *info) const  
    450265}
    451266
    452267
    453 /*! \brief Returns the next attribute in the node's list of attributes.
    454     Every BNode maintains a pointer to its list of attributes.
    455     GetNextAttrName() retrieves the name of the attribute that the pointer is
    456     currently pointing to, and then bumps the pointer to the next attribute.
    457     The name is copied into the buffer, which should be at least
    458     B_ATTR_NAME_LENGTH characters long. The copied name is NULL-terminated.
    459     When you've asked for every name in the list, GetNextAttrName()
    460     returns \c B_ENTRY_NOT_FOUND.
    461     \param buffer the buffer the name of the next attribute shall be stored in
    462            (must be at least \c B_ATTR_NAME_LENGTH bytes long)
    463     \return
    464     - \c B_OK: Everything went fine.
    465     - \c B_BAD_VALUE: \c NULL \a buffer.
    466     - \c B_FILE_ERROR: The object is not initialized.
    467     - \c B_ENTRY_NOT_FOUND: There are no more attributes, the last attribute
    468       name has already been returned.
    469 */
    470268status_t
    471269BNode::GetNextAttrName(char *buffer)
    472270{
    BNode::GetNextAttrName(char *buffer)  
    489287}
    490288
    491289
    492 /*! \brief Resets the object's attribute pointer to the first attribute in the
    493     list.
    494     \return
    495     - \c B_OK: Everything went fine.
    496     - \c B_FILE_ERROR: Some error occured.
    497 */
    498290status_t
    499291BNode::RewindAttrs()
    500292{
    BNode::RewindAttrs()  
    505297}
    506298
    507299
    508 /*! Writes the specified string to the specified attribute, clobbering any
    509     previous data.
    510     \param name the name of the attribute
    511     \param data the BString to be written to the attribute
    512     - \c B_OK: Everything went fine.
    513     - \c B_BAD_VALUE: \c NULL \a name or \a data
    514     - \c B_FILE_ERROR: The object is not initialized or the node it refers to
    515       is read only.
    516     - \c B_NOT_ALLOWED: The node resides on a read only volume.
    517     - \c B_DEVICE_FULL: Insufficient disk space.
    518     - \c B_NO_MEMORY: Insufficient memory to complete the operation.
    519 */
    520300status_t
    521301BNode::WriteAttrString(const char *name, const BString *data)
    522302{
    BNode::WriteAttrString(const char *name, const BString *data)  
    532312}
    533313
    534314
    535 /*! \brief Reads the data of the specified attribute into the pre-allocated
    536            \a result.
    537     \param name the name of the attribute
    538     \param result the BString to be set to the value of the attribute
    539     \return
    540     - \c B_OK: Everything went fine.
    541     - \c B_BAD_VALUE: \c NULL \a name or \a result
    542     - \c B_FILE_ERROR: The object is not initialized.
    543     - \c B_ENTRY_NOT_FOUND: The node has no attribute \a attr.
    544 */
    545315status_t
    546316BNode::ReadAttrString(const char *name, BString *result) const
    547317{
    BNode::ReadAttrString(const char *name, BString *result) const  
    577347}
    578348
    579349
    580 /*! \brief Reinitializes the object as a copy of the \a node.
    581     \param node the BNode to be copied
    582     \return a reference to this BNode object.
    583 */
    584350BNode&
    585351BNode::operator=(const BNode &node)
    586352{
    BNode::operator=(const BNode &node)  
    598364}
    599365
    600366
    601 /*! Tests whether this and the supplied BNode object are equal.
    602     Two BNode objects are said to be equal if they're set to the same node,
    603     or if they're both \c B_NO_INIT.
    604     \param node the BNode to be compared with
    605     \return \c true, if the BNode objects are equal, \c false otherwise
    606 */
    607367bool
    608368BNode::operator==(const BNode &node) const
    609369{
    BNode::operator==(const BNode &node) const  
    622382}
    623383
    624384
    625 /*! Tests whether this and the supplied BNode object are not equal.
    626     Two BNode objects are said to be equal if they're set to the same node,
    627     or if they're both \c B_NO_INIT.
    628     \param node the BNode to be compared with
    629     \return \c false, if the BNode objects are equal, \c true otherwise
    630 */
    631385bool
    632386BNode::operator!=(const BNode &node) const
    633387{
    BNode::operator!=(const BNode &node) const  
    635389}
    636390
    637391
    638 /*! \brief Returns a POSIX file descriptor to the node this object refers to.
    639     Remember to call close() on the file descriptor when you're through with
    640     it.
    641     \return a valid file descriptor, or -1, if something went wrong.
    642 */
    643392int
    644393BNode::Dup()
    645394{
    void BNode::_RudeNode5() { }  
    657406void BNode::_RudeNode6() { }
    658407
    659408
    660 /*! \brief Sets the node's file descriptor.
    661     Used by each implementation (i.e. BNode, BFile, BDirectory, etc.) to set
    662     the node's file descriptor. This allows each subclass to use the various
    663     file-type specific system calls for opening file descriptors.
    664     \param fd the file descriptor this BNode should be set to (may be -1)
    665     \return \c B_OK, if everything went fine, an error code otherwise.
    666     \note This method calls close_fd() to close previously opened FDs. Thus
    667           derived classes should take care to first call set_fd() and set
    668           class specific resources freed in their close_fd() version
    669           thereafter.
    670 */
    671409status_t
    672410BNode::set_fd(int fd)
    673411{
    BNode::set_fd(int fd)  
    678416}
    679417
    680418
    681 /*! \brief Closes the node's file descriptor(s).
    682     To be implemented by subclasses to close the file descriptor using the
    683     proper system call for the given file-type. This implementation calls
    684     _kern_close(fFd) and also _kern_close(fAttrDir) if necessary.
    685 */
    686419void
    687420BNode::close_fd()
    688421{
    BNode::close_fd()  
    697430}
    698431
    699432
    700 /*! \brief Sets the BNode's status.
    701     To be used by derived classes instead of accessing the BNode's private
    702     \c fCStatus member directly.
    703     \param newStatus the new value for the status variable.
    704 */
    705433void
    706434BNode::set_status(status_t newStatus)
    707435{
    BNode::set_status(status_t newStatus)  
    709437}
    710438
    711439
    712 /*! \brief Initializes the BNode's file descriptor to the node referred to
    713            by the given FD and path combo.
    714 
    715     \a path must either be \c NULL, an absolute or a relative path.
    716     In the first case, \a fd must not be \c NULL; the node it refers to will
    717     be opened. If absolute, \a fd is ignored. If relative and \a fd is >= 0,
    718     it will be reckoned off the directory identified by \a fd, otherwise off
    719     the current working directory.
    720 
    721     The method will first try to open the node with read and write permission.
    722     If that fails due to a read-only FS or because the user has no write
    723     permission for the node, it will re-try opening the node read-only.
    724 
    725     The \a fCStatus member will be set to the return value of this method.
    726 
    727     \param fd Either a directory FD or a value < 0. In the latter case \a path
    728            must be specified.
    729     \param path Either \a NULL in which case \a fd must be given, absolute, or
    730            relative to the directory specified by \a fd (if given) or to the
    731            current working directory.
    732     \param traverse If the node identified by \a fd and \a path is a symlink
    733            and \a traverse is \c true, the symlink will be resolved recursively.
    734     \return \c B_OK, if everything went fine, another error code otherwise.
    735 */
    736440status_t
    737441BNode::_SetTo(int fd, const char *path, bool traverse)
    738442{
    BNode::_SetTo(int fd, const char *path, bool traverse)  
    752456}
    753457
    754458
    755 /*! \brief Initializes the BNode's file descriptor to the node referred to
    756            by the given entry_ref.
    757 
    758     The method will first try to open the node with read and write permission.
    759     If that fails due to a read-only FS or because the user has no write
    760     permission for the node, it will re-try opening the node read-only.
    761 
    762     The \a fCStatus member will be set to the return value of this method.
    763 
    764     \param ref An entry_ref identifying the node to be opened.
    765     \param traverse If the node identified by \a ref is a symlink
    766            and \a traverse is \c true, the symlink will be resolved recursively.
    767     \return \c B_OK, if everything went fine, another error code otherwise.
    768 */
    769459status_t
    770460BNode::_SetTo(const entry_ref *ref, bool traverse)
    771461{
    BNode::_SetTo(const entry_ref *ref, bool traverse)  
    787477}
    788478
    789479
    790 /*! \brief Modifies a certain setting for this node based on \a what and the
    791     corresponding value in \a st.
    792     Inherited from and called by BStatable.
    793     \param st a stat structure containing the value to be set
    794     \param what specifies what setting to be modified
    795     \return \c B_OK if everything went fine, an error code otherwise.
    796 */
    797480status_t
    798481BNode::set_stat(struct stat &st, uint32 what)
    799482{
    BNode::set_stat(struct stat &st, uint32 what)  
    805488}
    806489
    807490
    808 /*! \brief Verifies that the BNode has been properly initialized, and then
    809     (if necessary) opens the attribute directory on the node's file
    810     descriptor, storing it in fAttrDir.
    811     \return \c B_OK if everything went fine, an error code otherwise.
    812 */
    813491status_t
    814492BNode::InitAttrDir()
    815493{
    BNode::_GetStat(struct stat_beos *st) const  
    847525}
    848526
    849527
    850 /*! \var BNode::fFd
    851     File descriptor for the given node.
    852 */
    853 
    854 /*! \var BNode::fAttrFd
    855     File descriptor for the attribute directory of the node. Initialized lazily.
    856 */
    857 
    858 /*! \var BNode::fCStatus
    859     The object's initialization status.
    860 */
    861 
    862 
    863528// #pragma mark - symbol versions
    864529
    865530