Ticket #8008: BNode_remove_documentation_from_source.diff
File BNode_remove_documentation_from_source.diff, 20.1 KB (added by , 13 years ago) |
---|
-
headers/os/storage/Node.h
diff --git headers/os/storage/Node.h headers/os/storage/Node.h index 06f8ed4..bb22e74 100644
class BString; 14 14 struct entry_ref; 15 15 16 16 17 //! Reference structure to a particular vnode on a particular device18 /*! <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.023 */24 17 struct node_ref { 25 18 node_ref(); 26 19 node_ref(const node_ref &ref); … … struct node_ref { 34 27 }; 35 28 36 29 37 //! A BNode represents a chunk of data in the filesystem.38 /*! The BNode class provides an interface for manipulating the data and attributes39 belonging to filesystem entries. The BNode is unaware of the name that refers40 to it in the filesystem (i.e. its entry); a BNode is solely concerned with41 the entry's data and attributes.42 43 44 @author <a href='mailto:tylerdauwalder@users.sf.net'>Tyler Dauwalder</a>45 @version 0.0.046 47 */48 30 class BNode : public BStatable { 49 31 public: 50 32 BNode(); -
src/kits/storage/Node.cpp
diff --git src/kits/storage/Node.cpp src/kits/storage/Node.cpp index 0def72e..1fc1fa7 100644
8 8 */ 9 9 10 10 11 /*!12 \file Node.cpp13 BNode implementation.14 */15 16 11 #include <Node.h> 17 12 18 13 #include <errno.h> … … 37 32 // #pragma mark - node_ref 38 33 39 34 40 /*! \brief Creates an uninitialized node_ref object.41 */42 35 node_ref::node_ref() 43 36 : device((dev_t)-1), 44 37 node((ino_t)-1) … … node_ref::node_ref() 46 39 } 47 40 48 41 // copy constructor 49 /*! \brief Creates a copy of the given node_ref object.50 \param ref the node_ref to be copied51 */52 42 node_ref::node_ref(const node_ref &ref) 53 43 : device((dev_t)-1), 54 44 node((ino_t)-1) … … node_ref::node_ref(const node_ref &ref) 57 47 } 58 48 59 49 // == 60 /*! \brief Tests whether this node_ref and the supplied one are equal.61 \param ref the node_ref to be compared with62 \return \c true, if the objects are equal, \c false otherwise63 */64 50 bool 65 51 node_ref::operator==(const node_ref &ref) const 66 52 { … … node_ref::operator==(const node_ref &ref) const 68 54 } 69 55 70 56 // != 71 /*! \brief Tests whether this node_ref and the supplied one are not equal.72 \param ref the node_ref to be compared with73 \return \c false, if the objects are equal, \c true otherwise74 */75 57 bool 76 58 node_ref::operator!=(const node_ref &ref) const 77 59 { … … node_ref::operator!=(const node_ref &ref) const 79 61 } 80 62 81 63 // = 82 /*! \brief Makes this node ref a copy of the supplied one.83 \param ref the node_ref to be copied84 \return a reference to this object85 */86 64 node_ref& 87 65 node_ref::operator=(const node_ref &ref) 88 66 { … … node_ref::operator=(const node_ref &ref) 95 73 // #pragma mark - BNode 96 74 97 75 98 /*! \brief Creates an uninitialized BNode object99 */100 76 BNode::BNode() 101 77 : fFd(-1), 102 78 fAttrFd(-1), … … BNode::BNode() 105 81 } 106 82 107 83 108 /*! \brief Creates a BNode object and initializes it to the specified109 entry_ref.110 \param ref the entry_ref referring to the entry111 */112 84 BNode::BNode(const entry_ref *ref) 113 85 : fFd(-1), 114 86 fAttrFd(-1), … … BNode::BNode(const entry_ref *ref) 118 90 } 119 91 120 92 121 /*! \brief Creates a BNode object and initializes it to the specified122 filesystem entry.123 \param entry the BEntry representing the entry124 */125 93 BNode::BNode(const BEntry *entry) 126 94 : fFd(-1), 127 95 fAttrFd(-1), … … BNode::BNode(const BEntry *entry) 131 99 } 132 100 133 101 134 /*! \brief Creates a BNode object and initializes it to the entry referred135 to by the specified path.136 \param path the path referring to the entry137 */138 102 BNode::BNode(const char *path) 139 103 : fFd(-1), 140 104 fAttrFd(-1), … … BNode::BNode(const char *path) 144 108 } 145 109 146 110 147 /*! \brief Creates a BNode object and initializes it to the entry referred148 to by the specified path rooted in the specified directory.149 \param dir the BDirectory, relative to which the entry's path name is150 given151 \param path the entry's path name relative to \a dir152 */153 111 BNode::BNode(const BDirectory *dir, const char *path) 154 112 : fFd(-1), 155 113 fAttrFd(-1), … … BNode::BNode(const BDirectory *dir, const char *path) 159 117 } 160 118 161 119 162 /*! \brief Creates a copy of the given BNode.163 \param node the BNode to be copied164 */165 120 BNode::BNode(const BNode &node) 166 121 : fFd(-1), 167 122 fAttrFd(-1), … … BNode::BNode(const BNode &node) 171 126 } 172 127 173 128 174 /*! \brief Frees all resources associated with the BNode.175 */176 129 BNode::~BNode() 177 130 { 178 131 Unset(); 179 132 } 180 133 181 134 182 /*! \brief Checks whether the object has been properly initialized or not.183 \return184 - \c B_OK, if the object has been properly initialized,185 - an error code, otherwise.186 */187 135 status_t 188 136 BNode::InitCheck() const 189 137 { … … BNode::InitCheck() const 191 139 } 192 140 193 141 194 /*! \fn status_t BNode::GetStat(struct stat *st) const195 \brief Fills in the given stat structure with \code stat() \endcode196 information for this object.197 \param st a pointer to a stat structure to be filled in198 \return199 - \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 initialized202 */203 204 205 /*! \brief Reinitializes the object to the specified entry_ref.206 \param ref the entry_ref referring to the entry207 \return208 - \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 */213 142 status_t 214 143 BNode::SetTo(const entry_ref *ref) 215 144 { … … BNode::SetTo(const entry_ref *ref) 217 146 } 218 147 219 148 220 /*! \brief Reinitializes the object to the specified filesystem entry.221 \param entry the BEntry representing the entry222 \return223 - \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 */228 149 status_t 229 150 BNode::SetTo(const BEntry *entry) 230 151 { … … BNode::SetTo(const BEntry *entry) 236 157 } 237 158 238 159 239 /*! \brief Reinitializes the object to the entry referred to by the specified240 path.241 \param path the path referring to the entry242 \return243 - \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 */248 160 status_t 249 161 BNode::SetTo(const char *path) 250 162 { … … BNode::SetTo(const char *path) 252 164 } 253 165 254 166 255 /*! \brief Reinitializes the object to the entry referred to by the specified256 path rooted in the specified directory.257 \param dir the BDirectory, relative to which the entry's path name is258 given259 \param path the entry's path name relative to \a dir260 \return261 - \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 */266 167 status_t 267 168 BNode::SetTo(const BDirectory *dir, const char *path) 268 169 { … … BNode::SetTo(const BDirectory *dir, const char *path) 274 175 } 275 176 276 177 277 /*! \brief Returns the object to an uninitialized state.278 */279 178 void 280 179 BNode::Unset() 281 180 { … … BNode::Unset() 284 183 } 285 184 286 185 287 /*! \brief Attains an exclusive lock on the data referred to by this node, so288 that it may not be modified by any other objects or methods.289 \return290 - \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 */294 186 status_t 295 187 BNode::Lock() 296 188 { … … BNode::Lock() 300 192 } 301 193 302 194 303 /*! \brief Unlocks the node.304 \return305 - \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 */309 195 status_t 310 196 BNode::Unlock() 311 197 { … … BNode::Unlock() 315 201 } 316 202 317 203 318 /*! \brief Immediately performs any pending disk actions on the node.319 \return320 - \c B_OK: Everything went fine.321 - an error code, if something went wrong.322 */323 204 status_t 324 205 BNode::Sync() 325 206 { … … BNode::Sync() 327 208 } 328 209 329 210 330 /*! \brief Writes data from a buffer to an attribute.331 Write the \a len bytes of data from \a buffer to332 the attribute specified by \a name after erasing any data333 that existed previously. The type specified by \a type \em is334 remembered, and may be queried with GetAttrInfo(). The value of335 \a offset is currently ignored.336 \param attr the name of the attribute337 \param type the type of the attribute338 \param offset the index at which to write the data (currently ignored)339 \param buffer the buffer containing the data to be written340 \param len the number of bytes to be written341 \return342 - the number of bytes actually written343 - \c B_BAD_VALUE: \c NULL \a attr or \a buffer344 - \c B_FILE_ERROR: The object is not initialized or the node it refers to345 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 */350 211 ssize_t 351 212 BNode::WriteAttr(const char *attr, type_code type, off_t offset, 352 213 const void *buffer, size_t len) … … BNode::WriteAttr(const char *attr, type_code type, off_t offset, 361 222 } 362 223 363 224 364 /*! \brief Reads data from an attribute into a buffer.365 Reads the data of the attribute given by \a name into366 the buffer specified by \a buffer with length specified367 by \a len. \a type and \a offset are currently ignored.368 \param attr the name of the attribute369 \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 read372 \param len the number of bytes to be read373 \return374 - the number of bytes actually read375 - \c B_BAD_VALUE: \c NULL \a attr or \a buffer376 - \c B_FILE_ERROR: The object is not initialized.377 - \c B_ENTRY_NOT_FOUND: The node has no attribute \a attr.378 */379 225 ssize_t 380 226 BNode::ReadAttr(const char *attr, type_code type, off_t offset, 381 227 void *buffer, size_t len) const … … BNode::ReadAttr(const char *attr, type_code type, off_t offset, 390 236 } 391 237 392 238 393 /*! \brief Deletes the attribute given by \a name.394 \param name the name of the attribute395 - \c B_OK: Everything went fine.396 - \c B_BAD_VALUE: \c NULL \a name397 - \c B_FILE_ERROR: The object is not initialized or the node it refers to398 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 */402 239 status_t 403 240 BNode::RemoveAttr(const char *name) 404 241 { … … BNode::RemoveAttr(const char *name) 406 243 } 407 244 408 245 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 renamed412 \param newname the new name for the attribute413 \return414 - \c B_OK: Everything went fine.415 - \c B_BAD_VALUE: \c NULL \a oldname or \a newname416 - \c B_FILE_ERROR: The object is not initialized or the node it refers to417 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 */421 246 status_t 422 247 BNode::RenameAttr(const char *oldname, const char *newname) 423 248 { … … BNode::RenameAttr(const char *oldname, const char *newname) 428 253 } 429 254 430 255 431 /*! \brief Fills in the pre-allocated attr_info struct pointed to by \a info432 with useful information about the attribute specified by \a name.433 \param name the name of the attribute434 \param info the attr_info structure to be filled in435 \return436 - \c B_OK: Everything went fine.437 - \c B_BAD_VALUE: \c NULL \a name438 - \c B_FILE_ERROR: The object is not initialized.439 - \c B_ENTRY_NOT_FOUND: The node has no attribute \a name.440 */441 256 status_t 442 257 BNode::GetAttrInfo(const char *name, struct attr_info *info) const 443 258 { … … BNode::GetAttrInfo(const char *name, struct attr_info *info) const 450 265 } 451 266 452 267 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 is456 currently pointing to, and then bumps the pointer to the next attribute.457 The name is copied into the buffer, which should be at least458 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 in462 (must be at least \c B_ATTR_NAME_LENGTH bytes long)463 \return464 - \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 attribute468 name has already been returned.469 */470 268 status_t 471 269 BNode::GetNextAttrName(char *buffer) 472 270 { … … BNode::GetNextAttrName(char *buffer) 489 287 } 490 288 491 289 492 /*! \brief Resets the object's attribute pointer to the first attribute in the493 list.494 \return495 - \c B_OK: Everything went fine.496 - \c B_FILE_ERROR: Some error occured.497 */498 290 status_t 499 291 BNode::RewindAttrs() 500 292 { … … BNode::RewindAttrs() 505 297 } 506 298 507 299 508 /*! Writes the specified string to the specified attribute, clobbering any509 previous data.510 \param name the name of the attribute511 \param data the BString to be written to the attribute512 - \c B_OK: Everything went fine.513 - \c B_BAD_VALUE: \c NULL \a name or \a data514 - \c B_FILE_ERROR: The object is not initialized or the node it refers to515 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 */520 300 status_t 521 301 BNode::WriteAttrString(const char *name, const BString *data) 522 302 { … … BNode::WriteAttrString(const char *name, const BString *data) 532 312 } 533 313 534 314 535 /*! \brief Reads the data of the specified attribute into the pre-allocated536 \a result.537 \param name the name of the attribute538 \param result the BString to be set to the value of the attribute539 \return540 - \c B_OK: Everything went fine.541 - \c B_BAD_VALUE: \c NULL \a name or \a result542 - \c B_FILE_ERROR: The object is not initialized.543 - \c B_ENTRY_NOT_FOUND: The node has no attribute \a attr.544 */545 315 status_t 546 316 BNode::ReadAttrString(const char *name, BString *result) const 547 317 { … … BNode::ReadAttrString(const char *name, BString *result) const 577 347 } 578 348 579 349 580 /*! \brief Reinitializes the object as a copy of the \a node.581 \param node the BNode to be copied582 \return a reference to this BNode object.583 */584 350 BNode& 585 351 BNode::operator=(const BNode &node) 586 352 { … … BNode::operator=(const BNode &node) 598 364 } 599 365 600 366 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 with605 \return \c true, if the BNode objects are equal, \c false otherwise606 */607 367 bool 608 368 BNode::operator==(const BNode &node) const 609 369 { … … BNode::operator==(const BNode &node) const 622 382 } 623 383 624 384 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 with629 \return \c false, if the BNode objects are equal, \c true otherwise630 */631 385 bool 632 386 BNode::operator!=(const BNode &node) const 633 387 { … … BNode::operator!=(const BNode &node) const 635 389 } 636 390 637 391 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 with640 it.641 \return a valid file descriptor, or -1, if something went wrong.642 */643 392 int 644 393 BNode::Dup() 645 394 { … … void BNode::_RudeNode5() { } 657 406 void BNode::_RudeNode6() { } 658 407 659 408 660 /*! \brief Sets the node's file descriptor.661 Used by each implementation (i.e. BNode, BFile, BDirectory, etc.) to set662 the node's file descriptor. This allows each subclass to use the various663 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. Thus667 derived classes should take care to first call set_fd() and set668 class specific resources freed in their close_fd() version669 thereafter.670 */671 409 status_t 672 410 BNode::set_fd(int fd) 673 411 { … … BNode::set_fd(int fd) 678 416 } 679 417 680 418 681 /*! \brief Closes the node's file descriptor(s).682 To be implemented by subclasses to close the file descriptor using the683 proper system call for the given file-type. This implementation calls684 _kern_close(fFd) and also _kern_close(fAttrDir) if necessary.685 */686 419 void 687 420 BNode::close_fd() 688 421 { … … BNode::close_fd() 697 430 } 698 431 699 432 700 /*! \brief Sets the BNode's status.701 To be used by derived classes instead of accessing the BNode's private702 \c fCStatus member directly.703 \param newStatus the new value for the status variable.704 */705 433 void 706 434 BNode::set_status(status_t newStatus) 707 435 { … … BNode::set_status(status_t newStatus) 709 437 } 710 438 711 439 712 /*! \brief Initializes the BNode's file descriptor to the node referred to713 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 will717 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 off719 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 write723 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 path728 must be specified.729 \param path Either \a NULL in which case \a fd must be given, absolute, or730 relative to the directory specified by \a fd (if given) or to the731 current working directory.732 \param traverse If the node identified by \a fd and \a path is a symlink733 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 */736 440 status_t 737 441 BNode::_SetTo(int fd, const char *path, bool traverse) 738 442 { … … BNode::_SetTo(int fd, const char *path, bool traverse) 752 456 } 753 457 754 458 755 /*! \brief Initializes the BNode's file descriptor to the node referred to756 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 write760 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 symlink766 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 */769 459 status_t 770 460 BNode::_SetTo(const entry_ref *ref, bool traverse) 771 461 { … … BNode::_SetTo(const entry_ref *ref, bool traverse) 787 477 } 788 478 789 479 790 /*! \brief Modifies a certain setting for this node based on \a what and the791 corresponding value in \a st.792 Inherited from and called by BStatable.793 \param st a stat structure containing the value to be set794 \param what specifies what setting to be modified795 \return \c B_OK if everything went fine, an error code otherwise.796 */797 480 status_t 798 481 BNode::set_stat(struct stat &st, uint32 what) 799 482 { … … BNode::set_stat(struct stat &st, uint32 what) 805 488 } 806 489 807 490 808 /*! \brief Verifies that the BNode has been properly initialized, and then809 (if necessary) opens the attribute directory on the node's file810 descriptor, storing it in fAttrDir.811 \return \c B_OK if everything went fine, an error code otherwise.812 */813 491 status_t 814 492 BNode::InitAttrDir() 815 493 { … … BNode::_GetStat(struct stat_beos *st) const 847 525 } 848 526 849 527 850 /*! \var BNode::fFd851 File descriptor for the given node.852 */853 854 /*! \var BNode::fAttrFd855 File descriptor for the attribute directory of the node. Initialized lazily.856 */857 858 /*! \var BNode::fCStatus859 The object's initialization status.860 */861 862 863 528 // #pragma mark - symbol versions 864 529 865 530