You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/21 13:27:21 UTC

svn commit: r999316 - in /subversion/branches/object-model/subversion: bindings/c++/Utility.cpp bindings/c++/Utility.h bindings/c++/include/Types.h tests/libsvn++/util-test.cpp

Author: hwright
Date: Tue Sep 21 11:27:21 2010
New Revision: 999316

URL: http://svn.apache.org/viewvc?rev=999316&view=rev
Log:
On the object-model branch:
Add a new header to include some typedef's, and other sundry types.  Populate
it with a single typedef.

* subversion/bindings/c++/include/Types.h:
  New.

* subversion/bindings/c++/Utility.cpp,
  subversion/bindings/c++/Utility.h
  (make_prop_table): Use the PropTable type.

* subversion/tests/libsvn++/util-test.cpp
  (test_map_wrapping): Same.

Added:
    subversion/branches/object-model/subversion/bindings/c++/include/Types.h
Modified:
    subversion/branches/object-model/subversion/bindings/c++/Utility.cpp
    subversion/branches/object-model/subversion/bindings/c++/Utility.h
    subversion/branches/object-model/subversion/tests/libsvn++/util-test.cpp

Modified: subversion/branches/object-model/subversion/bindings/c++/Utility.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/Utility.cpp?rev=999316&r1=999315&r2=999316&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/Utility.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/c++/Utility.cpp Tue Sep 21 11:27:21 2010
@@ -76,11 +76,11 @@ make_string_array(const std::vector<std:
 }
 
 apr_hash_t *
-make_prop_table(const std::map<std::string, std::string> &props, Pool &pool)
+make_prop_table(const PropTable &props, Pool &pool)
 {
   apr_hash_t *hash = apr_hash_make(pool.pool());
 
-  for (std::map<std::string, std::string>::const_iterator it = props.begin();
+  for (PropTable::const_iterator it = props.begin();
        it != props.end(); ++it)
     {
       svn_string_t *str = svn_string_ncreate(it->second.data(),

Modified: subversion/branches/object-model/subversion/bindings/c++/Utility.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/Utility.h?rev=999316&r1=999315&r2=999316&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/Utility.h (original)
+++ subversion/branches/object-model/subversion/bindings/c++/Utility.h Tue Sep 21 11:27:21 2010
@@ -27,6 +27,7 @@
 #ifndef UTILITY_H
 #define UTILITY_H
 
+#include "Types.h"
 #include "Pool.h"
 
 #include "svn_pools.h"
@@ -53,7 +54,7 @@ apr_array_header_t *
 make_string_array(const std::vector<std::string> &vec, Pool &pool);
 
 apr_hash_t *
-make_prop_table(const std::map<std::string, std::string> &props, Pool &pool);
+make_prop_table(const PropTable &props, Pool &pool);
 
 }
 }

Added: subversion/branches/object-model/subversion/bindings/c++/include/Types.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/c%2B%2B/include/Types.h?rev=999316&view=auto
==============================================================================
--- subversion/branches/object-model/subversion/bindings/c++/include/Types.h (added)
+++ subversion/branches/object-model/subversion/bindings/c++/include/Types.h Tue Sep 21 11:27:21 2010
@@ -0,0 +1,41 @@
+/**
+ * @copyright
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file Types.h
+ * @brief Some helpful types
+ */
+
+#ifndef TYPES_H
+#define TYPES_H
+
+#include <map>
+#include <string>
+
+namespace SVN
+{
+
+typedef std::map<std::string, std::string> PropTable;
+
+}
+
+
+#endif // TYPES_H

Modified: subversion/branches/object-model/subversion/tests/libsvn++/util-test.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/libsvn%2B%2B/util-test.cpp?rev=999316&r1=999315&r2=999316&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/libsvn++/util-test.cpp (original)
+++ subversion/branches/object-model/subversion/tests/libsvn++/util-test.cpp Tue Sep 21 11:27:21 2010
@@ -138,7 +138,7 @@ static svn_error_t *
 test_map_wrapping(apr_pool_t *p)
 {
   Pool pool;
-  std::map<std::string, std::string> map;
+  PropTable map;
 
   map["one"] = "the lonliest number\000\001";
   map["two"] = "as bad as one\000\002";
@@ -146,7 +146,7 @@ test_map_wrapping(apr_pool_t *p)
   apr_hash_t *hash = Private::Utility::make_prop_table(map, pool);
   SVN_TEST_ASSERT(apr_hash_count(hash) == map.size());
 
-  std::map<std::string, std::string>::const_iterator it = map.begin();
+  PropTable::const_iterator it = map.begin();
   for (apr_hash_index_t *hi = apr_hash_first(pool.pool(), hash); hi;
         hi = apr_hash_next(hi), ++it)
     {