]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add description_init to parameter_handler
authorrao <rao@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Oct 2010 15:37:51 +0000 (15:37 +0000)
committerrao <rao@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 21 Oct 2010 15:37:51 +0000 (15:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@22420 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/parameter_handler.h
deal.II/base/source/parameter_handler.cc

index 223ff90194574b4777e99149ca7425da2ec978b2..05864f1e4e225941f702e2c33c3142ec49a18514 100644 (file)
@@ -276,7 +276,13 @@ namespace Patterns
                                        * a valid range.
                                        */
       const int upper_bound;
+      
+                       /**
+                    * Initial part of description
+                    */
+      static const char* description_init;              
   };
+  const char* Integer::description_init = "[Integer";
 
                                   /**
                                     * Test for the string being a
@@ -410,7 +416,13 @@ namespace Patterns
                                        * a valid range.
                                        */
       const double upper_bound;
+      
+                       /**
+                    * Initial part of description
+                    */
+      static const char* description_init;              
   };
+  const char* Double::description_init = "[Double";
 
                                   /**
                                     * Test for the string being one
@@ -483,7 +495,13 @@ namespace Patterns
                                        * the constructor.
                                        */
       std::string sequence;
+
+                       /**
+                    * Initial part of description
+                    */
+      static const char* description_init;              
   };
+  const char* Selection::description_init = "[Selection";
 
 
                                    /**
@@ -596,7 +614,13 @@ namespace Patterns
                                         * the list must have.
                                         */
       const unsigned int max_elements;
+
+                       /**
+                    * Initial part of description
+                    */
+      static const char* description_init;              
   };
+  const char* List::description_init = "[List";
 
                                   /**
                                     * This class is much like the
@@ -688,7 +712,13 @@ namespace Patterns
                                        * the constructor.
                                        */
       std::string sequence;
+
+                       /**
+                    * Initial part of description
+                    */
+      static const char* description_init;              
   };
+  const char* MultipleSelection::description_init = "[MultipleSelection";
 
                                   /**
                                     * Test for the string being
@@ -758,7 +788,13 @@ namespace Patterns
                                        * function.
                                        */
       virtual PatternBase * clone () const;
+
+                       /**
+                    * Initial part of description
+                    */
+      static const char* description_init;              
   };
+  const char* Anything::description_init = "[Anything";
 }
 
 
index b72d0ca709fe9eb3177eb6e56092766b292ce7e8..04349eb53d1753776e04ebb3ae77a62a87724f3c 100644 (file)
@@ -147,7 +147,8 @@ namespace Patterns
       {
        std::ostringstream description;
 
-       description << "[Integer range "
+       description << description_init
+               <<" range "
                    << lower_bound << "..." << upper_bound
                    << " (inclusive)]";
        return description.str();
@@ -215,14 +216,15 @@ namespace Patterns
 
   std::string Double::description () const
   {
+       std::ostringstream description;
+       
                                     // check whether valid bounds
                                     // were specified, and if so
                                     // output their values
     if (lower_bound <= upper_bound)
       {
-       std::ostringstream description;
-
-       description << "[Floating point range "
+       description << description_init
+               << " "
                    << lower_bound << "..." << upper_bound
                    << " (inclusive)]";
        return description.str();
@@ -230,7 +232,10 @@ namespace Patterns
     else
                                       // if no bounds were given, then
                                       // return generic string
-      return "[Double]";
+         {
+         description << description_init
+                     << "]";
+      return description.str();
   }
 
 
@@ -278,7 +283,14 @@ namespace Patterns
 
   std::string Selection::description () const
   {
-    return sequence;
+    std::ostringstream description;
+    
+    description << description_init
+                << " "
+                << sequence
+                << " ]";
+                
+    return description.str();
   }
 
 
@@ -379,9 +391,11 @@ namespace Patterns
   {
     std::ostringstream description;
 
-    description << "list of <" << pattern->description() << ">"
+    description << description_init
+                << " list of <" << pattern->description() << ">"
                 << " of length " << min_elements << "..." << max_elements
-                << " (inclusive)";
+                << " (inclusive)"
+                << "]";
 
     return description.str();
   }
@@ -483,7 +497,14 @@ namespace Patterns
 
   std::string MultipleSelection::description () const
   {
-    return sequence;
+    std::ostringstream description;
+    
+    description << description_init
+                << " "
+                << sequence
+                << " ]";
+                
+    return description.str();
   }
 
 
@@ -533,7 +554,12 @@ namespace Patterns
 
   std::string Anything::description () const
   {
-    return "[Anything]";
+    std::ostringstream description;
+    
+    description << description_init
+                << "]"
+                
+    return description.str();
   }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.