https://issues.shibboleth.net/jira/browse/CPPXT-42
authorScott Cantor <cantor.2@osu.edu>
Fri, 25 Sep 2009 16:00:54 +0000 (16:00 +0000)
committerScott Cantor <cantor.2@osu.edu>
Fri, 25 Sep 2009 16:00:54 +0000 (16:00 +0000)
xmltooling/XMLToolingConfig.cpp
xmltooling/XMLToolingConfig.h

index f154540..7e99906 100644 (file)
@@ -111,19 +111,19 @@ namespace xmltooling {
 #endif
 
 #ifdef WIN32
-    BOOL LogEvent(\r
-        LPCSTR  lpUNCServerName,\r
-        WORD  wType,\r
-        DWORD  dwEventID,\r
-        PSID  lpUserSid,\r
-        LPCSTR  message)\r
-    {\r
-        LPCSTR  messages[] = {message, NULL};\r
-\r
-        HANDLE hElog = RegisterEventSource(lpUNCServerName, "OpenSAML XMLTooling Library");\r
-        BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL);\r
-        return (DeregisterEventSource(hElog) && res);\r
-    }\r
+    BOOL LogEvent(
+        LPCSTR  lpUNCServerName,
+        WORD  wType,
+        DWORD  dwEventID,
+        PSID  lpUserSid,
+        LPCSTR  message)
+    {
+        LPCSTR  messages[] = {message, NULL};
+
+        HANDLE hElog = RegisterEventSource(lpUNCServerName, "OpenSAML XMLTooling Library");
+        BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL);
+        return (DeregisterEventSource(hElog) && res);
+    }
 #endif
 }
 
@@ -195,7 +195,7 @@ bool XMLToolingInternalConfig::log_config(const char* config)
         string msg = string("failed to configure logging: ") + e.what();
         Category::getInstance(XMLTOOLING_LOGCAT".Logging").crit(msg);
 #ifdef WIN32
-        LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str());\r
+        LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, msg.c_str());
 #endif
         return false;
     }
@@ -209,6 +209,12 @@ void XMLToolingConfig::setReplayCache(ReplayCache* replayCache)
     delete m_replayCache;
     m_replayCache = replayCache;
 }
+
+void XMLToolingConfig::setKeyInfoResolver(xmltooling::KeyInfoResolver *keyInfoResolver)
+{
+    delete m_keyInfoResolver;
+    m_keyInfoResolver = keyInfoResolver;
+}
 #endif
 
 void XMLToolingConfig::setPathResolver(PathResolver* pathResolver)
index 0f8ae43..3c24b2a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 Internet2
+ *  Copyright 2001-2009 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -159,15 +159,6 @@ namespace xmltooling {
 
 #ifndef XMLTOOLING_NO_XMLSEC
         /**
-         * Sets the global KeyInfoResolver instance.
-         * This method must be externally synchronized with any code that uses the object.
-         * Any previously set object is destroyed.
-         * 
-         * @param keyInfoResolver   new KeyInfoResolver instance to store
-         */
-        void setKeyInfoResolver(KeyInfoResolver* keyInfoResolver);
-
-        /**
          * Returns the global KeyInfoResolver instance.
          * 
          * @return  global KeyInfoResolver or NULL
@@ -177,15 +168,6 @@ namespace xmltooling {
         }
 
         /**
-         * Sets the global ReplayCache instance.
-         * This method must be externally synchronized with any code that uses the object.
-         * Any previously set object is destroyed.
-         * 
-         * @param replayCache   new ReplayCache instance to store
-         */
-        void setReplayCache(ReplayCache* replayCache);
-
-        /**
          * Returns the global ReplayCache instance.
          * 
          * @return  global ReplayCache or NULL
@@ -193,36 +175,36 @@ namespace xmltooling {
         ReplayCache* getReplayCache() const {
             return m_replayCache;
         }
-#endif
 
         /**
-         * Sets the global URLEncoder instance.
+         * Sets the global KeyInfoResolver instance.
          * This method must be externally synchronized with any code that uses the object.
          * Any previously set object is destroyed.
          * 
-         * @param urlEncoder   new URLEncoder instance to store
-         */
-        void setURLEncoder(URLEncoder* urlEncoder);
-        
-        /**
-         * Returns the global URLEncoder instance.
-         * 
-         * @return  global URLEncoder or NULL
+         * @param keyInfoResolver   new KeyInfoResolver instance to store
          */
-        const URLEncoder* getURLEncoder() const {
-            return m_urlEncoder;
-        }
-        
+        void setKeyInfoResolver(KeyInfoResolver* keyInfoResolver);
+
         /**
-         * Sets the global TemplateEngine instance.
+         * Sets the global ReplayCache instance.
          * This method must be externally synchronized with any code that uses the object.
          * Any previously set object is destroyed.
          * 
-         * @param templateEngine   new TemplateEngine instance to store
+         * @param replayCache   new ReplayCache instance to store
          */
-        void setTemplateEngine(TemplateEngine* templateEngine);
+        void setReplayCache(ReplayCache* replayCache);
+#endif
 
         /**
+         * Returns the global PathResolver instance.
+         * 
+         * @return  global PathResolver or NULL
+         */
+        PathResolver* getPathResolver() const {
+            return m_pathResolver;
+        }
+        
+        /**
          * Returns the global TemplateEngine instance.
          * 
          * @return  global TemplateEngine or NULL
@@ -232,6 +214,15 @@ namespace xmltooling {
         }
 
         /**
+         * Returns the global URLEncoder instance.
+         * 
+         * @return  global URLEncoder or NULL
+         */
+        const URLEncoder* getURLEncoder() const {
+            return m_urlEncoder;
+        }
+
+        /**
          * Sets the global PathResolver instance.
          * This method must be externally synchronized with any code that uses the object.
          * Any previously set object is destroyed.
@@ -239,15 +230,24 @@ namespace xmltooling {
          * @param pathResolver   new PathResolver instance to store
          */
         void setPathResolver(PathResolver* pathResolver);
+        
+        /**
+         * Sets the global TemplateEngine instance.
+         * This method must be externally synchronized with any code that uses the object.
+         * Any previously set object is destroyed.
+         * 
+         * @param templateEngine   new TemplateEngine instance to store
+         */
+        void setTemplateEngine(TemplateEngine* templateEngine);
 
         /**
-         * Returns the global PathResolver instance.
+         * Sets the global URLEncoder instance.
+         * This method must be externally synchronized with any code that uses the object.
+         * Any previously set object is destroyed.
          * 
-         * @return  global PathResolver or NULL
+         * @param urlEncoder   new URLEncoder instance to store
          */
-        PathResolver* getPathResolver() const {
-            return m_pathResolver;
-        }
+        void setURLEncoder(URLEncoder* urlEncoder);
         
         /**
          * List of catalog files to load into validating parser pool at initialization time.