]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve exception output and work around a bug in gcc3.0.1 where a \0 character was...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 18 Feb 2002 09:22:07 +0000 (09:22 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 18 Feb 2002 09:22:07 +0000 (09:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@5522 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_out.h
deal.II/deal.II/include/numerics/data_out_stack.h
deal.II/deal.II/source/numerics/data_out.cc
deal.II/deal.II/source/numerics/data_out_stack.cc

index 6f545cc72592e0468666e1de187d6b3957b13a1d..901d3d5905ebd26d270ebe4d71aaa63553e8fc94 100644 (file)
@@ -380,12 +380,14 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                     /**
                                      * Exception
                                      */
-    DeclException1 (ExcInvalidCharacter,
-                   std::string,
+    DeclException2 (ExcInvalidCharacter,
+                   std::string, size_t,
                    << "Please use only the characters [a-zA-Z0-9_<>()] for" << std::endl
                    << "description strings since some graphics formats will only accept these."
                    << std::endl
-                   << "The string you gave was <" << arg1 << ">.");
+                   << "The string you gave was <" << arg1
+                   << ">, the invalid character is <" << arg1[arg2]
+                   << ">." << std::endl);
                                     /**
                                      * Exception
                                      */
index 2ce4e639ec3cbda60c6114db8fde25d8c8411dfa..9cbed626424e5a30db7e004de97f4780ecd6306d 100644 (file)
@@ -297,11 +297,14 @@ class DataOutStack : public DataOutInterface<dim+1>
                                     /**
                                      * Exception
                                      */
-    DeclException1 (ExcInvalidCharacter,
-                   std::string,
+    DeclException2 (ExcInvalidCharacter,
+                   std::string, size_t,
                    << "Please use only the characters [a-zA-Z0-9_<>()] for" << std::endl
-                   << "description strings since AVS will only accept these." << std::endl
-                   << "The string you gave was <" << arg1 << ">.");
+                   << "description strings since some graphics formats will only accept these."
+                   << std::endl
+                   << "The string you gave was <" << arg1
+                   << ">, the invalid character is <" << arg1[arg2]
+                   << ">." << std::endl);
                                     /**
                                      * Exception
                                      */
index 8035bd65c80634df454738f7e150f0326f3eaee1..7779bfce783f8ec86834da98bf17fa4e229c8749 100644 (file)
@@ -169,7 +169,10 @@ add_data_vector (const VECTOR                   &vec,
     Assert (names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
                                       "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                       "0123456789_<>()") == std::string::npos,
-           ExcInvalidCharacter (names[i]));
+           ExcInvalidCharacter (names[i],
+                                names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
+                                                           "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                                           "0123456789_<>()")));
   
   DataEntry new_entry (&vec, names);
   if (actual_type == type_dof_data)
@@ -210,8 +213,8 @@ add_data_vector (const VECTOR         &vec,
 #else
          std::ostrstream namebuf;
 #endif
-         namebuf << name << '_' << i << std::ends;
-         names[i] = namebuf.str();
+         namebuf << '_' << i << std::ends;
+         names[i] = name + namebuf.str().c_str();
        };
     };
   
index b7e08a559fc287f4776fb78f42282780ebf6162f..b5a3359e096dd0de9d598a3bb9d77a3f6ab799c9 100644 (file)
@@ -158,7 +158,10 @@ void DataOutStack<dim>::add_data_vector (const Vector<number> &vec,
     Assert (names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
                                       "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                       "0123456789_<>()") == std::string::npos,
-           ExcInvalidCharacter (names[i]));
+           ExcInvalidCharacter (names[i],
+                                names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
+                                                           "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                                           "0123456789_<>()")));
   
   if (vec.size() == dof_handler->n_dofs())
     {

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.