[sword-svn] r1791 - trunk/src/utilfuns

scribe at crosswire.org scribe at crosswire.org
Mon May 2 20:52:13 MST 2005


Author: scribe
Date: 2005-05-02 20:52:13 -0700 (Mon, 02 May 2005)
New Revision: 1791

Added:
   trunk/src/utilfuns/swobject.cpp
Log:


Added: trunk/src/utilfuns/swobject.cpp
===================================================================
--- trunk/src/utilfuns/swobject.cpp	2005-05-03 03:49:04 UTC (rev 1790)
+++ trunk/src/utilfuns/swobject.cpp	2005-05-03 03:52:13 UTC (rev 1791)
@@ -0,0 +1,37 @@
+/******************************************************************************
+*  swobject.cpp  - code for SWObject used as lowest base class for many
+*	SWORD objects
+*
+* $Id: swobject.cpp 1785 2005-04-30 19:11:12Z scribe $
+*
+* Copyright 2005 CrossWire Bible Society (http://www.crosswire.org)
+*	CrossWire Bible Society
+*	P. O. Box 2528
+*	Tempe, AZ  85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* General Public License for more details.
+*
+*/
+
+#include <swobject.h>
+#include <utilstr.h>
+
+
+SWORD_NAMESPACE_START
+
+bool SWClass::isAssignableFrom(const char *className) const {
+	for (int i = 0; descends[i]; i++) {
+		if (!stricmp(descends[i], className))
+			return true;
+	}
+	return false;
+}
+
+SWORD_NAMESPACE_END



More information about the sword-cvs mailing list