1
1
//////////////////////////////////////////////////////////////////////////////
2
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : procutils.cpp
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : procutils.cpp
7
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
23
//////////////////////////////////////////////////////////////////////////////
24
24
//////////////////////////////////////////////////////////////////////////////
25
25
#include "wx/tokenzr.h"
413
413
proc->Read(tmpbuf);
417
//convert buff into wxArrayString
418
output = wxStringTokenize(buff, wxT("\n"));
417
// Convert buff into wxArrayString
418
buff.Trim().Trim(false);
420
int where = buff.Find(wxT("\n"));
421
while( where != wxNOT_FOUND ) {
422
// use c_str() to make sure we create a unique copy
423
s = buff.Mid(0, where).c_str();
424
s.Trim().Trim(false);
425
output.Add(s.c_str());
426
buff.Remove(0, where+1);
428
where = buff.Find(wxT("\n"));
431
if(buff.empty() == false){
432
s = buff.Trim().Trim(false);
433
output.Add(s.c_str());