rdf/base/public/rdf.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rdf/base/public/rdf.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/*
    1.10 +
    1.11 +  A catch-all header file for miscellaneous RDF stuff. Currently
    1.12 +  contains error codes and vocabulary macros.
    1.13 +
    1.14 + */
    1.15 +
    1.16 +#ifndef rdf_h___
    1.17 +#define rdf_h___
    1.18 +
    1.19 +#include "nsError.h"
    1.20 +
    1.21 +/**
    1.22 + * The following macros are to aid in vocabulary definition.  They
    1.23 + * creates const char*'s for "kURI[prefix]_[name]", appropriate
    1.24 + * complete namespace qualification on the URI, e.g.,
    1.25 + *
    1.26 + * #define RDF_NAMESPACE_URI "http://www.w3.org/TR/WD-rdf-syntax#"
    1.27 + * DEFINE_RDF_ELEMENT(RDF_NAMESPACE_URI, RDF, ID);
    1.28 + *
    1.29 + * will define:
    1.30 + *
    1.31 + * kURIRDF_ID to be "http://www.w3.org/TR/WD-rdf-syntax#ID"
    1.32 + */
    1.33 +
    1.34 +#define DEFINE_RDF_VOCAB(ns, prefix, name) \
    1.35 +static const char kURI##prefix##_##name[] = ns #name
    1.36 +
    1.37 +/**
    1.38 + * Core RDF vocabularies that we use to define semantics
    1.39 + */
    1.40 +
    1.41 +#define RDF_NAMESPACE_URI  "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    1.42 +#define WEB_NAMESPACE_URI  "http://home.netscape.com/WEB-rdf#"
    1.43 +#define NC_NAMESPACE_URI   "http://home.netscape.com/NC-rdf#"
    1.44 +#define DEVMO_NAMESPACE_URI_PREFIX "http://developer.mozilla.org/rdf/vocabulary/"
    1.45 +
    1.46 +
    1.47 +/* ContractID prefixes for RDF DLL registration. */
    1.48 +#define NS_RDF_CONTRACTID                           "@mozilla.org/rdf"
    1.49 +#define NS_RDF_DATASOURCE_CONTRACTID                NS_RDF_CONTRACTID "/datasource;1"
    1.50 +#define NS_RDF_DATASOURCE_CONTRACTID_PREFIX         NS_RDF_DATASOURCE_CONTRACTID "?name="
    1.51 +#define NS_RDF_RESOURCE_FACTORY_CONTRACTID          "@mozilla.org/rdf/resource-factory;1"
    1.52 +#define NS_RDF_RESOURCE_FACTORY_CONTRACTID_PREFIX   NS_RDF_RESOURCE_FACTORY_CONTRACTID "?name="
    1.53 +#define NS_RDF_INFER_DATASOURCE_CONTRACTID_PREFIX   NS_RDF_CONTRACTID "/infer-datasource;1?engine="
    1.54 +
    1.55 +#define NS_RDF_SERIALIZER                            NS_RDF_CONTRACTID "/serializer;1?format="
    1.56 +
    1.57 +// contract ID is in the form
    1.58 +// @mozilla.org/rdf/delegate-factory;1?key=<key>&scheme=<scheme>
    1.59 +#define NS_RDF_DELEGATEFACTORY_CONTRACTID    "@mozilla.org/rdf/delegate-factory;1"
    1.60 +#define NS_RDF_DELEGATEFACTORY_CONTRACTID_PREFIX    NS_RDF_DELEGATEFACTORY_CONTRACTID "?key="
    1.61 +
    1.62 +/*@}*/
    1.63 +
    1.64 +#endif /* rdf_h___ */

mercurial