Lines Matching refs:file

1633 		// manually added such a file :-)
1713 // manually added such a file :-)
2170 // Manually removes the file in the MIME database corresponding to
2177 // corresponding file is created in the database, we need to do
2189 // Manually verifies that the file in the MIME database corresponding to
2196 // corresponding file is created in the database, we need to do
2642 BFile file(&entry, B_READ_ONLY);
2643 CHK(file.InitCheck() == B_OK);
2645 CHK(msg.Unflatten(&file) == B_OK);
3195 // - set icon, preferred app, attr info, file ext., short/long desc.,
3224 // file extensions
3245 // - set icon, preferred app, attr info, file ext., short/long desc.,
3274 // file extensions
3291 // - set icon, preferred app, attr info, file ext., short/long desc.,
3321 // file extensions
3345 // - set icon, preferred app, attr info, file ext., short/long desc.,
3379 // file extensions
3514 BFile file(name.c_str(), B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
3515 status_t error = file.InitCheck();
3517 ssize_t written = file.Write(data, size);
3569 MimeInfoTestFile &file = files[i];
3571 CHK(file.Create() == B_OK);
3572 CHK(update_mime_info(file.name.c_str(), false, true, false) == B_OK);
3573 BNode node(file.name.c_str());
3578 CHK(type == file.type.c_str());
3579 CHK(file.Delete() == B_OK);
3581 CHK(file.Create() == B_OK);
3582 CHK(update_mime_info(file.name.c_str(), true, true, false) == B_OK);
3583 CHK(node.SetTo(file.name.c_str()) == B_OK);
3587 CHK(type == file.type.c_str());
3588 CHK(file.Delete() == B_OK);
3598 MimeInfoTestFile &file = files[i];
3600 CHK(file.Create() == B_OK);
3601 CHK(update_mime_info(file.name.c_str(), false, false, false) == B_OK);
3604 BNode node(file.name.c_str());
3609 CHK(type == file.type.c_str());
3610 CHK(file.Delete() == B_OK);
3612 CHK(file.Create() == B_OK);
3613 CHK(update_mime_info(file.name.c_str(), true, false, false) == B_OK);
3616 CHK(node.SetTo(file.name.c_str()) == B_OK);
3620 CHK(type == file.type.c_str());
3621 CHK(file.Delete() == B_OK);
3627 // file, should set the BEOS:TYPE attribute regardless of whether it already
3632 MimeInfoTestFile &file = files[i];
3633 //printf("file: %s\n", file.name.c_str());
3634 CHK(file.Create() == B_OK);
3636 BNode node(file.name.c_str());
3641 CHK(update_mime_info(file.name.c_str(), false, true, false) == B_OK);
3646 CHK(update_mime_info(file.name.c_str(), false, true, true) == B_OK);
3650 //printf("%s <-> %s\n", type.String(), file.type.c_str());
3651 CHK(type == file.type.c_str());
3652 CHK(file.Delete() == B_OK);
3660 MimeInfoTestFile &file = files[i];
3661 CHK(file.Create() == B_OK);
3667 MimeInfoTestFile &file = files[i];
3668 BNode node(file.name.c_str());
3675 MimeInfoTestFile &file = files[i];
3676 CHK(file.Delete() == B_OK);
3677 CHK(file.Create() == B_OK);
3682 MimeInfoTestFile &file = files[i];
3683 BNode node(file.name.c_str());
3688 CHK(type == file.type.c_str());
3692 MimeInfoTestFile &file = files[i];
3693 CHK(file.Delete() == B_OK);
3696 // bad args: non-existing file
3771 BFile file(name.c_str(), B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
3772 status_t error = file.InitCheck();
3777 error = WriteStringAttr(file, "BEOS:TYPE", type);
3780 error = WriteStringAttr(file, "BEOS:APP_SIG", signature);
3783 error = WriteStringAttr(file, "BEOS:SNIFF_RULE", snifferRule);
3786 ssize_t written = file.WriteAttr("BEOS:M:STD_ICON",
3796 ssize_t written = file.WriteAttr("META:L:STD_ICON",
3808 error = resources.SetTo(&file, true);
3826 // file types (ignored)
3873 CheckAppMetaMime(AppMimeTestFile &file)
3876 CHK(type.SetTo(file.signature.c_str()) == B_OK);
3881 BPath path(file.name.c_str(), NULL, true);
3886 CHK(file.signature == preferredApp);
3889 string typeFilename(string(mimeDatabaseDir) + "/" + file.signature);
3897 if (file.miniIcon) {
3900 CHK(memcmp(icon.Bits(), file.miniIcon, 256) == 0);
3903 /* if (file.miniIcon) {
3906 CHK(memcmp(icon.Bits(), file.largeIcon, 1024) == 0);
3977 // create file, create_app_meta_mime()
3978 AppMimeTestFile &file = files[i];
3979 CHK(file.Create(true, true) == B_OK);
3980 CHK(create_app_meta_mime(file.name.c_str(), false, true, false)
3983 CheckAppMetaMime(file);
3985 CHK(file.Delete(true) == B_OK);
3992 // create file, create_app_meta_mime()
3993 AppMimeTestFile &file = files[i];
3994 CHK(file.Create(true, false) == B_OK);
3995 CHK(create_app_meta_mime(file.name.c_str(), false, true, false)
3998 CheckAppMetaMime(file);
4000 CHK(file.Delete(true) == B_OK);
4006 // create file, create_app_meta_mime()
4007 AppMimeTestFile &file = files[i];
4008 CHK(file.Create(false, true) == B_OK);
4009 CHK(create_app_meta_mime(file.name.c_str(), false, true, false)
4013 CHK(type.SetTo(file.signature.c_str()) == B_OK);
4016 CHK(file.Delete(false) == B_OK);
4025 // create file, create_app_meta_mime()
4026 AppMimeTestFile &file = files[i];
4027 CHK(file.Create(true, true) == B_OK);
4028 CHK(create_app_meta_mime(file.name.c_str(), false, false, false)
4033 CheckAppMetaMime(file);
4035 CHK(file.Delete(true) == B_OK);
4041 // create file, create_app_meta_mime()
4042 AppMimeTestFile &file = files[i];
4043 CHK(file.Create(true, false) == B_OK);
4044 CHK(create_app_meta_mime(file.name.c_str(), false, false, false)
4049 CheckAppMetaMime(file);
4051 CHK(file.Delete(true) == B_OK);
4057 // create file, create_app_meta_mime()
4058 AppMimeTestFile &file = files[i];
4059 CHK(file.Create(false, true) == B_OK);
4060 CHK(create_app_meta_mime(file.name.c_str(), false, false, false)
4065 CHK(type.SetTo(file.signature.c_str()) == B_OK);
4068 CHK(file.Delete(false) == B_OK);
4076 // after modifying the original file (e.g. the mini icon attribute) or
4077 // calling it on another file with the same signature, should update the
4081 // same file, same signature, other parameters
4095 // create file 1, create_app_meta_mime()
4101 // create file 2, create_app_meta_mime(), no force
4115 // different file, same signature, other parameters
4129 // create file 1, create_app_meta_mime()
4135 // create file 2, create_app_meta_mime(), no force
4159 // non-existing file
4636 BFile file(name.c_str(), B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
4637 ssize_t error = file.InitCheck();
4639 ssize_t written = file.Write(data, size);
4646 error = file.WriteAttr("META:TYPE", B_STRING_TYPE, 0, metaType.c_str(),
4745 SniffingTestFile &file = files[i];
4746 const char *filename = file.name.c_str();
4747 //printf("file: %s\n", filename);
4748 const char *extensionType = file.extensionType.c_str();
4749 const char *contentType = file.contentType.c_str();
4751 if (file.contentType == "application/octet-stream")
4760 if (file.data != NULL) {
4761 CHK(BMimeType::GuessMimeType(file.data, file.size, &type) == B_OK);
4767 CHK(file.Create() == B_OK);
4777 printf("type: %s, should be: %s (file == '%s')\n", type.Type(), realType, filename);
4780 CHK(file.Delete() == B_OK);
4805 SniffingTestFile &file = files[0];
4806 CHK(file.Create() == B_OK);
4807 const char *filename = file.name.c_str();
4813 CHK(BMimeType::GuessMimeType(file.data, file.size, NULL)
4826 CHK(file.Delete() == B_OK);
4875 + status_t GuessMimeType(const entry_ref *file, BMimeType *result);