nsID.h revision 05339f5203fadf50294111c5716690842ac0dfd1
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync/* ***** BEGIN LICENSE BLOCK *****
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Version: MPL 1.1/GPL 2.0/LGPL 2.1
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * The contents of this file are subject to the Mozilla Public License Version
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * 1.1 (the "License"); you may not use this file except in compliance with
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * the License. You may obtain a copy of the License at
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Software distributed under the License is distributed on an "AS IS" basis,
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * for the specific language governing rights and limitations under the
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * The Original Code is mozilla.org code.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * The Initial Developer of the Original Code is
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Netscape Communications Corporation.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Portions created by the Initial Developer are Copyright (C) 1998
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * the Initial Developer. All Rights Reserved.
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * Contributor(s):
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * Alternatively, the contents of this file may be used under the terms of
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * either of the GNU General Public License Version 2 or later (the "GPL"),
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
43747b1f0bc8302a238fb35e55857a5e9aa1933dvboxsync * in which case the provisions of the GPL or the LGPL are applicable instead
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * of those above. If you wish to allow use of your version of this file only
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * under the terms of either the GPL or the LGPL, and not to allow others to
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * use your version of this file under the terms of the MPL, indicate your
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * decision by deleting the provisions above and replace them with the notice
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * and other provisions required by the GPL or the LGPL. If you do not delete
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * the provisions above, a recipient may use your version of this file under
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * the terms of any one of the MPL, the GPL or the LGPL.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * ***** END LICENSE BLOCK ***** */
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * A "unique identifier". This is modeled after OSF DCE UUIDs.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * @status FROZEN
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * @name Indentifier values
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * @name Methods
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Equivalency method. Compares this nsID with another.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * @return <b>PR_TRUE</b> if they are the same, <b>PR_FALSE</b> if not.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync // One would think that this could be done faster with a really
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync // efficient implementation of memcmp(), but evidently no
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync // memcmp()'s out there are better than this code.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync // See bug http://bugzilla.mozilla.org/show_bug.cgi?id=164580 for
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync // details.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync ((((PRUint32*) &m0)[0] == ((PRUint32*) &other.m0)[0]) &&
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync (((PRUint32*) &m0)[1] == ((PRUint32*) &other.m0)[1]) &&
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync (((PRUint32*) &m0)[2] == ((PRUint32*) &other.m0)[2]) &&
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync (((PRUint32*) &m0)[3] == ((PRUint32*) &other.m0)[3]));
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * nsID Parsing method. Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * string into an nsID
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * nsID string encoder. Returns an allocated string in
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format. Caller should free string.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * nsID string encoder. Builds a string in
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format, into a char[NSID_LENGTH]
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * buffer provided by the caller (for instance, on the stack).
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync NS_COM void ToProvidedString(char (&dest)[NSID_LENGTH]) const;
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Class IDs
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync// Define an CID
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * An "interface id" which can be used to uniquely identify a given
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * interface.
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * A macro shorthand for <tt>const nsIID&<tt>
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * Define an IID
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * obsolete - do not use this macro
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * A macro to build the static const IID accessor method
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync static const nsIID& GetIID() {static const nsIID iid = the_iid; return iid;}
caa941f0c7e5e632e27efc23a253533dd72148a5vboxsync * A macro to build the static const CID accessor method