fixed previous quick fix
authorAleš Křenek <ljocha@ics.muni.cz>
Thu, 6 Mar 2008 15:46:06 +0000 (15:46 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Thu, 6 Mar 2008 15:46:06 +0000 (15:46 +0000)
org.glite.lb.client/project/ChangeLog
org.glite.lb.client/src/Event.cpp.T
org.glite.lb.client/src/JobStatus.cpp.T

index 6599f81..e2370e0 100644 (file)
@@ -19,3 +19,7 @@
 3.1.3-1 (lb-1.7.5-1)
 - align attr_names[] (used in getAttrName methods) in Event and JobStatus
   to definitions in *.h from lb.client-interface 
+
+3.1.4-1
+- do the previous quick fix thoroughly -- don't smash name_with_underscores
+  and nameWithUppercaseLetters
index 5b15845..0c53fef 100644 (file)
@@ -324,12 +324,15 @@ Event::name(void) const
 static 
 std::string const attr_names[Event::ATTR_MAX] = {
 @@@{
-#      for (sort {$a cmp $b} getAllFields $event) {
-#              gen "\t\"$_\",\n";
-#      }
+       my %s;
+
+       for (getAllFields $event) {
+               my $id = $_;
+               $id =~ s/([a-z])([A-Z])/$1_$2/g;
+               $s{uc($id)} = $_;
+       }
        for (@main::EventAttrNames) {
-               $_ = lc $_;
-               gen "\t\"$_\",\n";
+               gen "\t\"$s{$_}\",\n";
        }
 @@@}
 };
index 1ea969d..3403039 100644 (file)
@@ -410,10 +410,15 @@ JobStatus::getValJobStatusList(Attr attr) const
 
 static std::string const attr_names[JobStatus::ATTR_MAX] = {
 @@@{
-#      for (sort {$a cmp $b} getAllFields $status) {
+       my %s;
+
+       for (getAllFields $status) {
+               my $id = $_;
+               $id =~ s/([a-z])([A-Z])/$1_$2/g;
+               $s{uc($id)} = $_;
+       }
        for (@main::StatusAttrNames) {
-               $_ = lc $_;
-               gen "\t\"$_\",\n";
+               gen "\t\"$s{$_}\",\n";
        }
 @@@}
 };