From 8415f44f68c9c9488376276544a98d91eb0a7572 Mon Sep 17 00:00:00 2001 From: guy <guy@c028cbd2-c16b-5b4b-a496-9718f37d4682> Date: Fri, 23 Sep 1994 10:58:04 +0000 Subject: [PATCH] Aggiunto nuovo operatore const [] alle stringhe git-svn-id: svn://10.65.10.50/trunk@286 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/form.cpp | 4 ++-- include/relation.cpp | 6 +++--- include/strings.h | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/form.cpp b/include/form.cpp index 149e59c2f..52adeb962 100755 --- a/include/form.cpp +++ b/include/form.cpp @@ -316,8 +316,8 @@ void TForm_item::send_message(const TString& cmd, TForm_item* des) const } else if (cmd[0] == '"') { - TString val(&cmd[1]); - val.cut(val.len()-1); + TString val(cmd); + val.strip("\""); des->set(val); } else error_box("Unknown message in item '%s': '%s'", diff --git a/include/relation.cpp b/include/relation.cpp index 660137c2f..21b7c3fbb 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -1,4 +1,4 @@ -// $Id: relation.cpp,v 1.11 1994-09-22 16:47:45 guy Exp $ +// $Id: relation.cpp,v 1.12 1994-09-23 10:58:03 guy Exp $ // relation.cpp // fv 12/8/93 // relation class for isam files @@ -1183,10 +1183,10 @@ TFieldref& TFieldref::operator =(const TString& s) if (par > 0) { pos = par+1; - _from = atoi(&s[pos]); + _from = atoi(s.mid(pos)); if (_from > 0) _from--; else _from = 0; par = s.find(',', pos); - if (par > 0) _to = atoi(&s[par+1]); else _to = -1; + if (par > 0) _to = atoi(s.mid(par+1)); else _to = -1; } else { diff --git a/include/strings.h b/include/strings.h index a5ac550a1..3db2d9e29 100755 --- a/include/strings.h +++ b/include/strings.h @@ -61,6 +61,8 @@ public: CHECKD(i >= 0 && i <= _size, "Bad string subscript: ", i); return _str[i]; } + + char operator[](int i) const { return _str[i]; } // TString[i] -> _str[i] int size() const { return _size; } int len() const { return strlen(_str); }