static const AclRoleName *FindAclRole(unsigned ulRights) { const AclRoleName rn = {ulRights, NULL}; const AclRoleName *lpRoleName = std::lower_bound(g_roles, arrayEnd(g_roles), rn); if (lpRoleName != arrayEnd(g_roles) && lpRoleName->ulRights == ulRights) return lpRoleName; return NULL; }
void JsonOut::property(const char *name, Parameters *parameters) { if (parameters == NULL || parameters->dim == 0) return; propertyStart(name); arrayStart(); if (parameters) for (size_t i = 0; i < parameters->dim; i++) { Parameter *p = (*parameters)[i]; objectStart(); if (p->ident) property("name", p->ident->toChars()); property("type", "deco", p->type); propertyStorageClass("storageClass", p->storageClass); if (p->defaultArg) property("default", p->defaultArg->toChars()); objectEnd(); } arrayEnd(); }
void JsonOut::propertyStorageClass(const char *name, StorageClass stc) { stc &= STCStorageClass; if (stc) { propertyStart(name); arrayStart(); while (stc) { char tmp[20]; const char *p = StorageClassDeclaration::stcToChars(tmp, stc); assert(p); assert(strlen(p) < sizeof(tmp) / sizeof(tmp[0])); if (p[0] == '@') { indent(); stringStart(); buf->writestring(p); stringEnd(); comma(); } else item(p); } arrayEnd(); } }