| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2006-2008 fullmetalcoder <[email protected]> |
| 4 | ** |
| 5 | ** This file is part of the Edyuk project <http://edyuk.org> |
| 6 | ** |
| 7 | ** This file may be used under the terms of the GNU General Public License |
| 8 | ** version 2 as published by the Free Software Foundation and appearing in the |
| 9 | ** file GPL.txt included in the packaging of this file. |
| 10 | ** |
| 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
| 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | ** |
| 14 | ****************************************************************************/ |
| 15 | |
| 16 | #include "qmanagedrequest.h"cxx . . $ `<file>/gui/src/qcumber/qmanagedrequest.h`/ |
| 17 | |
| 18 | /*! |
| 19 | \file qmanagedrequest.cpp |
| 20 | |
| 21 | \brief Implementation of the QManagedRequest class. |
| 22 | */ |
| 23 | |
| 24 | QManagedRequestcxx . . $ QManagedRequest#::QManagedRequestcxx . . $ QManagedRequest#QManagedRequest(4a8467afe4f213e4).(const QStringcxx . . $ QString#& cmd, const QStringListcxx . . $ QStringList#& args) |
| 25 | : sCommandcxx . . $ QManagedRequest#sCommand.(cmd), lArgumentscxx . . $ QManagedRequest#lArguments.(args) {} |
| 26 | |
| 27 | QManagedRequestcxx . . $ QManagedRequest#::QManagedRequestcxx . . $ QManagedRequest#QManagedRequest(f98399ab79b285f9).(const QManagedRequestcxx . . $ QManagedRequest#& r) |
| 28 | : sCommandcxx . . $ QManagedRequest#sCommand.(r.sCommandcxx . . $ QManagedRequest#sCommand.), lArgumentscxx . . $ QManagedRequest#lArguments.(r.lArgumentscxx . . $ QManagedRequest#lArguments.) {} |
| 29 | |
| 30 | QManagedRequestcxx . . $ QManagedRequest#::~cxx . . $ QManagedRequest#`~QManagedRequest`(49f6e7a06ebc5aa8).QManagedRequestcxx . . $ QManagedRequest#() { |
| 31 | sCommandcxx . . $ QManagedRequest#sCommand..clearcxx . . $ QString#clear(49f6e7a06ebc5aa8).(); |
| 32 | lArgumentscxx . . $ QManagedRequest#lArguments..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 33 | } |
| 34 | |
| 35 | QManagedRequestcxx . . $ QManagedRequest# QManagedRequestcxx . . $ QManagedRequest#::createSystemRequestcxx . . $ QManagedRequest#createSystemRequest(7480ad01d7bdafb5).(const QStringListcxx . . $ QStringList#& args, |
| 36 | int id) { |
| 37 | QManagedRequestcxx . . $ QManagedRequest# rcxx . . $ QManagedRequest#QManagedRequest(4a8467afe4f213e4).("--request"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 38 | r.lArgumentscxx . . $ QManagedRequest#lArguments. =cxx . . $ QStringList#`operator=`(cb3c3d1614140851). args; |
| 39 | r.lArgumentscxx . . $ QManagedRequest#lArguments..prependcxx . . $ QList#prepend(77d9f17553126ecb).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(id)); |
| 40 | |
| 41 | return rcxx . . $ QManagedRequest#QManagedRequest(f98399ab79b285f9).; |
| 42 | } |
| 43 | |
| 44 | QManagedRequestcxx . . $ QManagedRequest#& QManagedRequestcxx . . $ QManagedRequest#::operatorcxx . . $ QManagedRequest#`operator=`(8211f0adfdf33d3e).=(const QManagedRequestcxx . . $ QManagedRequest#& r) { |
| 45 | sCommandcxx . . $ QManagedRequest#sCommand. =cxx . . $ QString#`operator=`(6a89d0b7f4d2681c). r.sCommandcxx . . $ QManagedRequest#sCommand.; |
| 46 | lArgumentscxx . . $ QManagedRequest#lArguments. =cxx . . $ QStringList#`operator=`(cb3c3d1614140851). r.lArgumentscxx . . $ QManagedRequest#lArguments.; |
| 47 | |
| 48 | return *this; |
| 49 | } |
| 50 | |
| 51 | QStringcxx . . $ QString# QManagedRequestcxx . . $ QManagedRequest#::toStringcxx . . $ QManagedRequest#toString(6ef7b6c27b00b43d).() const { |
| 52 | return QStringcxx . . $ QString#QString(e1217c004a86c950).::fromUtf8cxx . . $ QString#fromUtf8(4e15edac36d215be).(joinArgumentscxx . . $ QManagedRequest#joinArguments(8efabc1b7032f324).(sCommandcxx . . $ QManagedRequest#sCommand., lArgumentscxx . . $ QManagedRequest#lArguments.)); |
| 53 | } |
| 54 | |
| 55 | QManagedRequestcxx . . $ QManagedRequest# QManagedRequestcxx . . $ QManagedRequest#::fromStringcxx . . $ QManagedRequest#fromString(f7227df19b382956).(const QStringcxx . . $ QString#& s) { |
| 56 | QManagedRequestcxx . . $ QManagedRequest# rcxx . . $ QManagedRequest#QManagedRequest(4a8467afe4f213e4).(""cxx . . $ QString#QString(85c52e162fed56f9).); |
| 57 | r.lArgumentscxx . . $ QManagedRequest#lArguments. =cxx . . $ QStringList#`operator=`(99dcbe54f9ac14fc). splitArgumentscxx . . $ QManagedRequest#splitArguments(c46ca66a5ac9bada).(s); |
| 58 | r.sCommandcxx . . $ QManagedRequest#sCommand. =cxx . . $ QString#`operator=`(7b76e6691bca1027). r.lArgumentscxx . . $ QManagedRequest#lArguments..takeAtcxx . . $ QList#takeAt(767fea59dce4185d).(0); |
| 59 | |
| 60 | return rcxx . . $ QManagedRequest#QManagedRequest(f98399ab79b285f9).; |
| 61 | } |
| 62 | |
| 63 | QStringListcxx . . $ QStringList# QManagedRequestcxx . . $ QManagedRequest#::splitArgumentscxx . . $ QManagedRequest#splitArguments(c46ca66a5ac9bada).(const QStringcxx . . $ QString#& s) { |
| 64 | int i = -1; |
| 65 | QStringListcxx . . $ QStringList# dcxx . . $ QStringList#QStringList(49f6e7a06ebc5aa8)., l = s.splitcxx . . $ QString#split(1b2294238e90052a).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("\\s"cxx . . $ QString#QString(85c52e162fed56f9).)); |
| 66 | |
| 67 | while (++i < l.countcxx . . $ QList#count(455f465bc33b4cdf).()) { |
| 68 | if (l.atcxx . . $ QList#at(e2681f9bb6b2f357).(i).startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).("\""cxx . . $ QString#QString(85c52e162fed56f9).)) { |
| 69 | QStringcxx . . $ QString# argcxx . . $ QString#QString(49f6e7a06ebc5aa8).; |
| 70 | |
| 71 | do { |
| 72 | arg +=cxx . . $ QString#`operator+=`(d02845eef0c33901). " "; |
| 73 | arg +=cxx . . $ QString#`operator+=`(6a89d0b7f4d2681c). l.atcxx . . $ QList#at(e2681f9bb6b2f357).(i); |
| 74 | } while (!arg.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("\""cxx . . $ QString#QString(85c52e162fed56f9).) && (++i < l.countcxx . . $ QList#count(455f465bc33b4cdf).())); |
| 75 | |
| 76 | arg.removecxx . . $ QString#remove(6483560ce2afa901).(0, 2); |
| 77 | |
| 78 | if (arg.endsWithcxx . . $ QString#endsWith(8cce4688c16f48f3).("\""cxx . . $ QString#QString(85c52e162fed56f9).)) arg.chopcxx . . $ QString#chop(d4f767463ce0a6b3).(1); |
| 79 | |
| 80 | d <<cxx . . $ QStringList#`operator<<`(85116071a693d053). arg; |
| 81 | } else { |
| 82 | d <<cxx . . $ QStringList#`operator<<`(85116071a693d053). l.atcxx . . $ QList#at(e2681f9bb6b2f357).(i); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | return d; |
| 87 | } |
| 88 | |
| 89 | QByteArraycxx . . $ QByteArray# QManagedRequestcxx . . $ QManagedRequest#::joinArgumentscxx . . $ QManagedRequest#joinArguments(8efabc1b7032f324).(const QStringcxx . . $ QString#& cmd, |
| 90 | const QStringListcxx . . $ QStringList#& l) { |
| 91 | QByteArraycxx . . $ QByteArray# msgcxx . . $ QByteArray#QByteArray(49f6e7a06ebc5aa8).; |
| 92 | |
| 93 | msg +=cxx . . $ QByteArray#`operator+=`(85c7caed82076bbb). cmd.toUtf8cxx . . $ QString#toUtf8(ef52b713090bc85a).(); |
| 94 | |
| 95 | foreachcxx . . $ `<external>/15045578679651060896/qglobal.h:1145:13`! (QString a, l) { |
| 96 | if (a.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) continue; |
| 97 | |
| 98 | if (a.containscxx . . $ QString#contains(493fc6ca23db3119).(QRegExpcxx . . $ QRegExp#QRegExp(31e086911ff70bd0).("\\s"cxx . . $ QString#QString(85c52e162fed56f9).))) a =cxx . . $ QString#`operator=`(6a89d0b7f4d2681c). "\"" +cxx . . $ operator+(c75c3ae4eb9af1a8). a +cxx . . $ operator+(3d22f08efddf8107). "\""; |
| 99 | |
| 100 | msg +=cxx . . $ QByteArray#`operator+=`(715145f812399bcb). " "; |
| 101 | msg +=cxx . . $ QByteArray#`operator+=`(85c7caed82076bbb). a.toUtf8cxx . . $ QString#toUtf8(ef52b713090bc85a).(); |
| 102 | } |
| 103 | |
| 104 | return msgcxx . . $ QByteArray#QByteArray(3203d9f8f38841a4).; |
| 105 | } |