1/* 2 * Copyright 2011, Haiku inc. 3 * Distributed under the terms of the MIT Licence. 4 * 5 * Documentation by: 6 * John Scipione <jscipione@gmail.com> 7 * Ingo Weinhold <bonefish@users.sf.net> 8 * Corresponds to: 9 * /trunk/headers/os/storage/AppFileInfo.h rev 42274 10 * /trunk/src/kits/storage/AppFileInfo.cpp rev 42274 11 */ 12 13 14/*! 15 \file AppFileInfo.h 16 \brief Provides the BAppFileInfo class. 17*/ 18 19 20/*! 21 \class BAppFileInfo 22 \ingroup storage 23 \brief Provides access to the metadata associated with executables, 24 libraries and add-ons. 25 26 The BAppFileInfo class allows for information about an executable or 27 add-on to be accessed or set. Information about an executable that can be 28 accessed include the signature, catalog entry, supported MIME types, 29 application flags, icon(s), and version info. 30 31 You should initialize the BAppFileInfo with a BFile object that represents 32 the executable or add-on that you want to access. If you only want to read 33 metadata from the file you do not have to open it for reading. However, if 34 you also want to write metadata then you should open the BFile for writing. 35 36 To associate a BFile with a BAppFileInfo object you can either pass the 37 BFile object into the constructor or you can use the empty constructor and 38 then use the SetTo() method to set the BFile to the BAppFileInfo object. 39 40 When accessing information from a BFileInfo object it will first look in the 41 attributes of the BFile. If the information is not found then the BFileInfo 42 object will next look at the resource of the BFile. You can tell the 43 BFileInfo object to look only in the attributes or resources with the 44 SetInfoLocation() method. 45*/ 46 47 48/*! 49 \fn BAppFileInfo::BAppFileInfo() 50 \brief Creates an uninitialized BAppFileInfo object. 51*/ 52 53 54/*! 55 \fn BAppFileInfo::BAppFileInfo(BFile* file) 56 \brief Creates an BAppFileInfo object and initializes it to the supplied 57 file. 58 59 The caller retains ownership of the supplied BFile object. It must not 60 be deleted during the life time of the BAppFileInfo. It is not deleted 61 when the BAppFileInfo is destroyed. 62 63 \param file The BFile object that the BAppFileInfo object shall be 64 initialized to. 65*/ 66 67 68/*! 69 \fn BAppFileInfo::~BAppFileInfo() 70 \brief Frees all resources associated with this object. 71 72 The supplied BFile object is not deleted if one is specified. 73*/ 74 75 76/*! 77 \fn status_t BAppFileInfo::SetTo(BFile *file) 78 \brief Initializes the BAppFileInfo to the supplied file. 79 80 The caller retains ownership of the supplied BFile object. It must not 81 be deleted during the life time of the BAppFileInfo. The BFile object 82 is not deleted when the BAppFileInfo is destroyed. 83 84 \param file The BFile object that the BAppFileInfo object shall be 85 initialized to. 86 87 \returns an status code. 88 \retval B_OK Everything went fine. 89 \retval B_BAD_VALUE \c NULL \a file or \a file is not properly initialized. 90*/ 91 92 93/*! 94 \name MIME Type 95*/ 96 97 98//! @{ 99 100 101/*! 102 \fn status_t BAppFileInfo::GetType(char *type) const 103 \brief Gets the MIME type of the associated file. 104 105 \param type A pointer to a pre-allocated character buffer of size 106 \c B_MIME_TYPE_LENGTH or larger into which the MIME type of the 107 file will be written. 108 109 \returns A status code. 110 \retval B_OK Everything went fine. 111 \retval B_NO_INIT The object is not properly initialized. 112 \retval B_BAD_VALUE \c NULL \a type or the type string stored in the 113 attribute/resources is longer than \c B_MIME_TYPE_LENGTH. 114 \retval B_BAD_TYPE The attribute/resources the type string is stored in 115 has the wrong type. 116 \retval B_ENTRY_NOT_FOUND No type is set on the file. 117*/ 118 119 120/*! 121 \fn status_t BAppFileInfo::SetType(const char* type) 122 \brief Sets the MIME type of the associated file. 123 124 If \a type is \c NULL if the file's MIME type is unset. 125 126 \param type The MIME type to be assigned to the file. It must not be 127 longer than \c B_MIME_TYPE_LENGTH (including the terminating null). 128 The MIME type may be \c NULL. 129 130 \returns a status code. 131 \retval B_OK Everything went fine. 132 \retval B_NO_INIT The object is not properly initialized. 133 \retval B_BAD_VALUE \a type is longer than \c B_MIME_TYPE_LENGTH. 134*/ 135 136 137//! @} 138 139 140/*! 141 \name Signature 142*/ 143 144 145//! @{ 146 147 148/*! 149 \fn status_t BAppFileInfo::GetSignature(char* signature) const 150 \brief Gets the application signature of the associated file. 151 152 \param signature A pointer to a pre-allocated character buffer of size 153 \c B_MIME_TYPE_LENGTH or larger into which the application 154 signature of the file will be written. 155 156 \returns a status code. 157 \retval B_OK Everything went fine. 158 \retval B_NO_INIT The object is not properly initialized. 159 \retval B_BAD_VALUE \c NULL \a signature or the signature stored in the 160 attribute/resources is longer than \c B_MIME_TYPE_LENGTH. 161 \retval B_BAD_TYPE The attribute/resources the signature is stored in have 162 the wrong type. 163 \retval B_ENTRY_NOT_FOUND No signature is set on the file. 164*/ 165 166 167/*! 168 \fn status_t BAppFileInfo::SetSignature(const char* signature) 169 \brief Sets the application signature of the associated file. 170 171 If \a signature is \c NULL the file's application signature is unset. 172 173 \param signature The application signature to be assigned to the file. 174 Must not be longer than \c B_MIME_TYPE_LENGTH (including the 175 terminating \c NUL). The \a signature may be \c NULL. 176 177 \returns a status code. 178 \retval B_OK Everything went fine. 179 \retval B_NO_INIT The object is not properly initialized. 180 \retval B_BAD_VALUE \a signature is longer than \c B_MIME_TYPE_LENGTH. 181*/ 182 183 184//! @} 185 186 187/*! 188 \name Catalog Entry 189*/ 190 191 192//! @{ 193 194 195/*! 196 \fn status_t BAppFileInfo::GetCatalogEntry(char *catalogEntry) const 197 \brief Gets the catalog entry of the associated file used for localization. 198 199 \param catalogEntry A pointer to a pre-allocated character buffer of size 200 \c B_MIME_TYPE_LENGTH * 3 or larger into which the catalog entry 201 of the file will be written. 202 203 \returns a status code. 204 \retval B_OK Everything went fine. 205 \retval B_NO_INIT The object is not properly initialized. 206 \retval B_BAD_VALUE \c NULL \a catalogEntry or the entry stored in the 207 attribute/resources is longer than \c B_MIME_TYPE_LENGTH * 3. 208 \retval B_BAD_TYPE The attribute/resources the entry is stored in have 209 the wrong type. 210 \retval B_ENTRY_NOT_FOUND No catalog entry is set on the file. 211*/ 212 213 214/*! 215 \fn status_t BAppFileInfo::SetCatalogEntry(const char* catalogEntry) 216 \brief Sets the catalog entry of the associated file used for localization. 217 218 If \a catalogEntry is \c NULL the file's catalog entry is unset. 219 220 \param catalogEntry The catalog entry to be assigned to the file. 221 Of the form "x-vnd.Haiku-app:context:name". Must not be longer than 222 \c B_MIME_TYPE_LENGTH * 3 (including the terminating \c NUL). 223 The \a catalogEntry may be \c NULL. 224 225 \returns a status code. 226 \retval B_OK Everything went fine. 227 \retval B_NO_INIT The object is not properly initialized. 228 \retval B_BAD_VALUE \a catalogEntry is longer than 229 \c B_MIME_TYPE_LENGTH * 3. 230*/ 231 232 233//! @} 234 235 236/*! 237 \name Application Flags 238*/ 239 240 241//! @{ 242 243 244/*! 245 \fn status_t BAppFileInfo::GetAppFlags(uint32* flags) const 246 \brief Gets the application \a flags of the associated file. 247 248 \param flags A pointer to a pre-allocated \c uint32 into which the 249 application flags of the file are written. 250 251 \returns A status code. 252 \retval B_OK Everything went fine. 253 \retval B_NO_INIT The object is not properly initialized. 254 \retval B_BAD_VALUE \c NULL \a flags. 255 \retval B_BAD_TYPE The attribute/resources the flags are stored in have 256 the wrong type. 257 \retval B_ENTRY_NOT_FOUND No application flags are set on the file. 258*/ 259 260 261/*! 262 \fn status_t BAppFileInfo::SetAppFlags(uint32 flags) 263 \brief Sets the application \a flags of the associated file. 264 265 \param flags The application \a flags to be assigned to the file. 266 267 \returns A status code. 268 \retval B_OK Everything went fine. 269 \retval B_NO_INIT The object was not properly initialized. 270*/ 271 272 273/*! 274 \fn status_t BAppFileInfo::RemoveAppFlags() 275 \brief Removes the application flags from the associated file. 276 277 \returns A status code. 278 \retval B_OK Everything went fine. 279 \retval B_NO_INIT The object was not properly initialized. 280*/ 281 282 283//! @} 284 285 286/*! 287 \name Supported MIME Types 288*/ 289 290 291//! @{ 292 293 294/*! 295 \fn status_t BAppFileInfo::GetSupportedTypes(BMessage* types) const 296 \brief Gets the MIME types supported by the application. 297 298 The supported MIME types are added to a field "types" of type 299 \c B_STRING_TYPE in \a types. 300 301 \param types A pointer to a pre-allocated BMessage into which the 302 MIME types supported by the application will be written. 303 304 \returns A status code. 305 \retval B_OK Everything went fine. 306 \retval B_NO_INIT The object is not properly initialized. 307 \retval B_BAD_VALUE \c NULL \a types. 308 \retval B_BAD_TYPE The attribute/resources that the supported types 309 are stored in have the wrong type. 310 \retval B_ENTRY_NOT_FOUND No supported types are set on the file. 311*/ 312 313 314/*! 315 \fn status_t BAppFileInfo::SetSupportedTypes(const BMessage* types, 316 bool syncAll) 317 \brief Sets the MIME types that are supported by the application and allows 318 you to specify whether or not the no longer supported types shall be 319 updated as well. 320 321 If \a types is \c NULL then the application's supported types are unset. 322 323 The supported MIME types must be stored in a field "types" of type 324 \c B_STRING_TYPE in \a types. 325 326 The method informs the registrar about this news. 327 For each supported type the result of BMimeType::GetSupportingApps() 328 will afterwards include the signature of this application. That is, 329 the application file needs to have a signature set. 330 331 \a syncAll specifies whether the no longer supported types shall be 332 updated as well, i.e. whether or not this application shall be removed 333 from the list of supporting applications. 334 335 \param types The supported types to be assigned to the file. 336 May be \c NULL. 337 \param syncAll \c true to also synchronize the no-longer supported 338 types, \c false otherwise. 339 340 \returns A status code. 341 \retval B_OK Everything went fine. 342 \retval B_NO_INIT The object is not properly initialized. 343*/ 344 345 346/*! 347 \fn status_t BAppFileInfo::SetSupportedTypes(const BMessage* types) 348 \brief Sets the MIME types supported by the application. 349 350 This method is a short-hand for SetSupportedTypes(types, false). 351 \see SetSupportedType(const BMessage*, bool) for detailed information. 352 353 \param types The supported types to be assigned to the file. 354 May be \c NULL. 355 \returns A status code. 356 \retval B_OK Everything went fine. 357 \retval B_NO_INIT The object is not properly initialized. 358*/ 359 360 361/*! 362 \fn bool BAppFileInfo::IsSupportedType(const char* type) const 363 \brief Returns whether the application supports the supplied MIME type. 364 365 If the application supports the wildcard type "application/octet-stream" 366 then this method returns \c true for any MIME type. 367 368 \param type The MIME type in question. 369 370 \returns \c true if \a type is a valid MIME type and it is supported by 371 the application, \c false otherwise. 372*/ 373 374 375/*! 376 \fn bool BAppFileInfo::Supports(BMimeType* type) const 377 \brief Returns whether the application supports the supplied MIME type 378 explicitly. 379 380 Unlike IsSupportedType(), this method returns \c true, only if the type 381 is explicitly supported, regardless of whether it supports 382 "application/octet-stream". 383 384 \param type The MIME type in question. 385 386 \returns \c true if \a type is a valid MIME type and it is explicitly 387 supported by the application, \c false otherwise. 388*/ 389 390 391//! @} 392 393 394/*! 395 \name Application Icon 396*/ 397 398 399//! @{ 400 401 402/*! 403 \fn status_t BAppFileInfo::GetIcon(BBitmap* icon, icon_size which) const 404 \brief Gets the icon of the associated file and puts it into a pre-allocated 405 BBitmap. 406 407 \param icon A pointer to a pre-allocated BBitmap of the correct dimension 408 to store the requested icon (16x16 for the \c B_MINI_ICON and 32x32 409 for the \c B_LARGE_ICON). 410 \param which Specifies the size of the icon to be retrieved: 411 \c B_MINI_ICON for the mini and \c B_LARGE_ICON for the large icon. 412 For HVIF icons this parameter has no effect. 413 414 \returns A status code. 415 \retval B_OK Everything went fine. 416 \retval B_NO_INIT The object is not properly initialized. 417 \retval B_BAD_VALUE \c NULL \a icon, unsupported icon size \a which or 418 bitmap dimensions (\a icon) and icon size (\a which) do not match. 419*/ 420 421 422/*! 423 \fn status_t BAppFileInfo::GetIcon(uint8** data, size_t* size) const 424 \brief Gets the icon of the associated file and puts it into a buffer. 425 426 \param data The pointer in which the flat icon data will be returned. 427 \param size The pointer in which the size of the data found will be 428 returned. 429 430 \returns A status code. 431 \retval B_OK Everything went fine. 432 \retval B_NO_INIT The object is not properly initialized. 433 \retval B_BAD_VALUE \c NULL \a data or \c NULL size. 434*/ 435 436 437/*! 438 \fn status_t BAppFileInfo::SetIcon(const BBitmap* icon, icon_size which) 439 \brief Sets the icon of the associated file from a BBitmap. 440 441 If \a icon is \c NULL then the icon of the file is unset. 442 443 \param icon A pointer to the BBitmap containing the icon to be set. 444 May be \c NULL to specify no icon. 445 \param which Specifies the size of the icon to be set: \c B_MINI_ICON for 446 16x16 mini icon and \c B_LARGE_ICON for the 32x32 large icon. 447 For HVIF icons this parameter has no effect. 448 449 \returns A status code. 450 \retval B_OK Everything went fine. 451 \retval B_NO_INIT The object is not properly initialized. 452 \retval B_BAD_VALUE Unknown icon size \a which or bitmap dimensions 453 (\a icon) and icon size (\a which) do not match. 454*/ 455 456 457/*! 458 \fn status_t BAppFileInfo::SetIcon(const uint8* data, size_t size) 459 \brief Sets the icon of the associated file from a buffer. 460 461 If \a data is \c NULL then the icon of the file is unset. 462 463 \param data A pointer to the data buffer containing the vector icon 464 to be set. May be \c NULL. 465 \param size Specifies the size of buffer pointed to by \a data. 466 467 \returns A status code. 468 \retval B_OK Everything went fine. 469 \retval B_NO_INIT The object is not properly initialized. 470 \retval B_BAD_VALUE \c NULL data. 471*/ 472 473 474/*! 475 \fn status_t BAppFileInfo::GetIconForType(const char* type, BBitmap* icon, 476 icon_size size) const 477 \brief Gets the icon the application provides for a given MIME type and 478 puts it into a BBitmap. 479 480 \note If \a type is \c NULL, the application's icon is retrieved. 481 482 \param type The MIME type in question. May be \c NULL. 483 \param icon A pointer to a pre-allocated BBitmap of the correct dimension 484 to store the requested icon (16x16 for the mini and 32x32 for the 485 large icon). 486 \param size Specifies the size of the icon to be retrieved: 487 \c B_MINI_ICON for the mini and \c B_LARGE_ICON for the large icon. 488 489 \returns A status code. 490 \retval B_OK Everything went fine. 491 \retval B_NO_INIT The object is not properly initialized. 492 \retval B_BAD_VALUE \c NULL \a icon, unsupported icon size 493 \a which or bitmap dimensions (\a icon) and icon size (\a which) do 494 not match. 495*/ 496 497 498/*! 499 \fn status_t BAppFileInfo::GetIconForType(const char* type, uint8** data, 500 size_t* size) const 501 \brief Gets the icon the application provides for a given MIME type and 502 puts it into a buffer. 503 504 \note If \a type is set to \c NULL the the application's icon is retrieved. 505 506 \param type The MIME type in question. May be \c NULL. 507 \param data A pointer in which the icon data will be returned. When you 508 are done with the data, you should use free() to deallocate it. 509 \param size A pointer in which the size of the retrieved data is returned. 510 511 \returns A status code. 512 \retval B_OK Everything went fine. 513 \retval B_NO_INIT The object is not properly initialized. 514 \retval B_BAD_VALUE \c NULL \a data and/or \a size. Or the supplied 515 \a type is not a valid MIME type. 516*/ 517 518 519/*! 520 \fn status_t BAppFileInfo::SetIconForType(const char* type, 521 const BBitmap* icon, icon_size which) 522 \brief Sets the icon the application provides for a given MIME type from a 523 BBitmap. 524 525 \note If \a type is \c NULL then the icon is set. 526 \note If \a icon is \c NULL then the icon is unset. 527 528 If the file has a signature, then the icon is also set on the MIME type. 529 If the type for the signature has not been installed yet, it is installed 530 before. 531 532 \param type The MIME type in question. May be \c NULL. 533 \param icon A pointer to the BBitmap containing the icon to be set. 534 May be \c NULL. 535 \param which Specifies the size of the icon to be set: \c B_MINI_ICON 536 for the mini and \c B_LARGE_ICON for the large icon. 537 538 \returns A status code. 539 \retval B_OK Everything went fine. 540 \retval B_NO_INIT The object is not properly initialized. 541 \retval B_BAD_VALUE Either the icon size \a which is unknown, 542 the bitmap dimensions (\a icon) and icon size (\a which) do not 543 match, or the provided \a type is not a valid MIME type. 544*/ 545 546 547/*! 548 \fn status_t BAppFileInfo::SetIconForType(const char* type, 549 const uint8* data, size_t size) 550 \brief Sets the icon the application provides for a given MIME type from a 551 buffer. 552 553 \note If \a type is \c NULL then the icon is set. 554 \note If \a data is \c NULL then the icon is unset. 555 556 If the file has a signature, then the icon is also set on the MIME type. 557 If the type for the signature has not been installed yet, it is 558 installed before. 559 560 \param type The MIME type in question. May be \c NULL. 561 \param data A pointer to the data containing the icon to be set. 562 May be \c NULL. 563 \param size Specifies the size of buffer provided in \a data. 564 565 \returns A status code. 566 \retval B_OK Everything went fine. 567 \retval B_NO_INIT The object is not properly initialized. 568 \retval B_BAD_VALUE The provided \a type is not a valid MIME type. 569*/ 570 571 572//! @} 573 574 575/*! 576 \name Version Info 577*/ 578 579 580//! @{ 581 582 583/*! 584 \fn status_t BAppFileInfo::GetVersionInfo(version_info* info, 585 version_kind kind) const 586 \brief Gets the version info of the associated file. 587 588 \param info A pointer to a pre-allocated version_info structure into 589 which the version info should be written. 590 \param kind Specifies the kind of the version info to be retrieved: 591 - \c B_APP_VERSION_KIND for the application's version info and 592 - \c B_SYSTEM_VERSION_KIND for the suite's info the application 593 belongs to. 594 595 \returns A status code. 596 \retval B_OK Everything went fine. 597 \retval B_NO_INIT The object is not properly initialized. 598 \retval B_BAD_VALUE \c NULL \a info. 599*/ 600 601 602/*! 603 \fn status_t BAppFileInfo::SetVersionInfo(const version_info* info, 604 version_kind kind) 605 \brief Sets the version info of the associated file. 606 607 \note If \a info is set to \c NULL then the file's version info is unset. 608 609 \param info The version info to be set. May be \c NULL. 610 \param kind Specifies kind of version info to be set: 611 - \c B_APP_VERSION_KIND for the application's version info and 612 - \c B_SYSTEM_VERSION_KIND for the suite's info the application 613 belongs to. 614 615 \returns A status code. 616 \retval B_OK Everything went fine. 617 \retval B_NO_INIT The object is not properly initialized. 618*/ 619 620 621//! @} 622 623 624/*! 625 \name Attributes/Resources 626*/ 627 628 629//! @{ 630 631 632/*! 633 \fn void BAppFileInfo::SetInfoLocation(info_location location) 634 \brief Specifies the location where the metadata shall be stored. 635 636 The options for \a location are: 637 - \c B_USE_ATTRIBUTES: Store the data in the attributes. 638 - \c B_USE_RESOURCES: Store the data in the resources. 639 - \c B_USE_BOTH_LOCATIONS: Store the data in attributes and resources. 640 641 \param location The location where the metadata shall be stored. 642*/ 643 644 645/*! 646 \fn bool BAppFileInfo::IsUsingAttributes() const 647 \brief Returns whether the object (also) stores the metadata in the 648 attributes of the associated file. 649 650 \returns \c true if the metadata are (also) stored in the file's 651 attributes, \c false otherwise. 652*/ 653 654 655/*! 656 \fn bool BAppFileInfo::IsUsingResources() const 657 \brief Returns whether the object (also) stores the metadata in the 658 resources of the associated file. 659 660 \returns \c true if the metadata are (also) stored in the file's 661 resources, \c false otherwise. 662*/ 663 664 665//! @} 666 667 668/*! 669 \fn BAppFileInfo & BAppFileInfo::operator=(const BAppFileInfo &) 670 \brief Privatized assignment operator to prevent usage. 671*/ 672 673 674/*! 675 \fn BAppFileInfo::BAppFileInfo(const BAppFileInfo &) 676 \brief Privatized copy constructor to prevent usage. 677*/ 678 679 680/*! 681 \fn status_t BAppFileInfo::GetMetaMime(BMimeType* meta) const 682 \brief Initializes a BMimeType to the signature of the associated file. 683 684 \warning The parameter \a meta is not checked. 685 686 \param meta A pointer to a pre-allocated BMimeType that shall be 687 initialized to the signature of the associated file. 688 689 \returns A status code. 690 \retval B_OK Everything went fine. 691 \retval B_BAD_VALUE \c NULL \a meta 692 \retval B_ENTRY_NOT_FOUND The file has not signature or the signature is 693 (not installed in the MIME database.) no valid MIME string. 694*/ 695 696 697/*! 698 \fn status_t BAppFileInfo::_ReadData(const char* name, int32 id, 699 type_code type, void* buffer, size_t bufferSize, 700 size_t &bytesRead, void** allocatedBuffer) const 701 \brief Reads data from an attribute or resource. 702 703 \note The data is read from the location specified by \a fWhere. 704 705 \warning The object must be properly initialized. The parameters are 706 \b NOT checked. 707 708 \param name The name of the attribute/resource to be read. 709 \param id The resource ID of the resource to be read. It is ignored 710 when < 0. 711 \param type The type of the attribute/resource to be read. 712 \param buffer A pre-allocated buffer for the data to be read. 713 \param bufferSize The size of the supplied buffer. 714 \param bytesRead A reference parameter, set to the number of bytes 715 actually read. 716 \param allocatedBuffer If not \c NULL, the method allocates a buffer 717 large enough too store the whole data and writes a pointer to it 718 into this variable. If \c NULL, the supplied buffer is used. 719 720 \returns A status code. 721 \retval B_OK Everything went fine. 722 \retval B_ENTRY_NOT_FOUND The entry was not found. 723 \retval B_NO_MEMORY Ran out of memory allocating the buffer. 724 \retval B_BAD_VALUE \a type did not match. 725*/ 726 727 728/*! 729 \fn status_t BAppFileInfo::_WriteData(const char* name, int32 id, 730 type_code type, const void* buffer, size_t bufferSize, bool findID) 731 \brief Writes data to an attribute or resource. 732 733 \note The data is written to the location(s) specified by \a fWhere. 734 735 \warning The object must be properly initialized. The parameters are 736 \b NOT checked. 737 738 \param name The name of the attribute/resource to be written. 739 \param id The resource ID of the resource to be written. 740 \param type The type of the attribute/resource to be written. 741 \param buffer A buffer containing the data to be written. 742 \param bufferSize The size of the supplied buffer. 743 \param findID If set to \c true use the ID that is already assigned to the 744 \a name / \a type pair or take the first unused ID >= \a id. 745 If \c false, \a id is used. 746 747 \returns A status code. 748 \retval B_OK Everything went fine. 749 \retval B_ERROR An error occurred while trying to write the data. 750*/ 751 752 753/*! 754 \fn status_t BAppFileInfo::_RemoveData(const char* name, type_code type) 755 \brief Removes an attribute or resource. 756 757 \note The removal location is specified by \a fWhere. 758 759 \warning The object must be properly initialized. The parameters are 760 \b NOT checked. 761 762 \param name The name of the attribute/resource to be remove. 763 \param type The type of the attribute/resource to be removed. 764 765 \returns A status code. 766 \retval B_OK Everything went fine. 767 \retval B_NO_INIT Not using attributes and not using resources. 768 \retval B_ENTRY_NOT_FOUND The attribute or resource was not found. 769*/ 770