- More style updates. Thanks Axel.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27081 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -194,7 +194,7 @@ class Inode {
|
|||||||
status_t AddAttribute(const char* name, type_code type,
|
status_t AddAttribute(const char* name, type_code type,
|
||||||
uint32 value);
|
uint32 value);
|
||||||
status_t RemoveAttribute(const char* name,
|
status_t RemoveAttribute(const char* name,
|
||||||
bool check_namespace = false);
|
bool checkNamespace = false);
|
||||||
|
|
||||||
void AddAttrCookie(attr_cookie* cookie);
|
void AddAttrCookie(attr_cookie* cookie);
|
||||||
void RemoveAttrCookie(attr_cookie* cookie);
|
void RemoveAttrCookie(attr_cookie* cookie);
|
||||||
@@ -1048,13 +1048,16 @@ Attribute::SetSize(off_t size)
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Attribute::IsProtectedNamespace() {
|
Attribute::IsProtectedNamespace()
|
||||||
|
{
|
||||||
// Check if the attribute is in the restricted namespace. Attributes in
|
// Check if the attribute is in the restricted namespace. Attributes in
|
||||||
// this namespace should not be edited by the user as they are handled
|
// this namespace should not be edited by the user as they are handled
|
||||||
// internally by the add-on.
|
// internally by the add-on.
|
||||||
return strncmp(kProtectedAttrNamespace, fName,
|
return strncmp(kProtectedAttrNamespace, fName,
|
||||||
strlen(kProtectedAttrNamespace)) == 0;
|
strlen(kProtectedAttrNamespace)) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - Inode class
|
// #pragma mark - Inode class
|
||||||
|
|
||||||
|
|
||||||
@@ -1214,7 +1217,7 @@ Inode::AddAttribute(const char* name, type_code type, uint32 value)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
Inode::RemoveAttribute(const char* name, bool check_namespace)
|
Inode::RemoveAttribute(const char* name, bool checkNamespace)
|
||||||
{
|
{
|
||||||
if (name == NULL || !name[0])
|
if (name == NULL || !name[0])
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
@@ -1225,7 +1228,7 @@ Inode::RemoveAttribute(const char* name, bool check_namespace)
|
|||||||
Attribute* attribute = iterator.Next();
|
Attribute* attribute = iterator.Next();
|
||||||
if (!strcmp(attribute->Name(), name)) {
|
if (!strcmp(attribute->Name(), name)) {
|
||||||
// check for restricted namespace if required.
|
// check for restricted namespace if required.
|
||||||
if (check_namespace && attribute->IsProtectedNamespace())
|
if (checkNamespace && attribute->IsProtectedNamespace())
|
||||||
return B_NOT_ALLOWED;
|
return B_NOT_ALLOWED;
|
||||||
// look for attribute in cookies
|
// look for attribute in cookies
|
||||||
AttrCookieList::Iterator i = fAttrCookies.GetIterator();
|
AttrCookieList::Iterator i = fAttrCookies.GetIterator();
|
||||||
|
|||||||
Reference in New Issue
Block a user