From b6974c9149403c0ffafb422f6a298498ec185814 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Thu, 6 Mar 2008 15:46:06 +0000 Subject: [PATCH] fixed previous quick fix --- org.glite.lb.client/project/ChangeLog | 4 ++++ org.glite.lb.client/src/Event.cpp.T | 13 ++++++++----- org.glite.lb.client/src/JobStatus.cpp.T | 11 ++++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/org.glite.lb.client/project/ChangeLog b/org.glite.lb.client/project/ChangeLog index 6599f81..e2370e0 100644 --- a/org.glite.lb.client/project/ChangeLog +++ b/org.glite.lb.client/project/ChangeLog @@ -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 diff --git a/org.glite.lb.client/src/Event.cpp.T b/org.glite.lb.client/src/Event.cpp.T index 5b15845..0c53fef 100644 --- a/org.glite.lb.client/src/Event.cpp.T +++ b/org.glite.lb.client/src/Event.cpp.T @@ -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"; } @@@} }; diff --git a/org.glite.lb.client/src/JobStatus.cpp.T b/org.glite.lb.client/src/JobStatus.cpp.T index 1ea969d..3403039 100644 --- a/org.glite.lb.client/src/JobStatus.cpp.T +++ b/org.glite.lb.client/src/JobStatus.cpp.T @@ -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"; } @@@} }; -- 1.8.2.3