xref: /aosp_15_r20/external/libbrillo/brillo/process_information.cc (revision 1a96fba65179ea7d3f56207137718607415c5953)
1*1a96fba6SXin Li // Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2*1a96fba6SXin Li // Use of this source code is governed by a BSD-style license that can be
3*1a96fba6SXin Li // found in the LICENSE file.
4*1a96fba6SXin Li 
5*1a96fba6SXin Li #include "brillo/process_information.h"
6*1a96fba6SXin Li 
7*1a96fba6SXin Li namespace brillo {
8*1a96fba6SXin Li 
ProcessInformation()9*1a96fba6SXin Li ProcessInformation::ProcessInformation() : cmd_line_(), process_id_(-1) {
10*1a96fba6SXin Li }
~ProcessInformation()11*1a96fba6SXin Li ProcessInformation::~ProcessInformation() {
12*1a96fba6SXin Li }
13*1a96fba6SXin Li 
GetCommandLine()14*1a96fba6SXin Li std::string ProcessInformation::GetCommandLine() {
15*1a96fba6SXin Li   std::string result;
16*1a96fba6SXin Li   for (std::vector<std::string>::iterator cmd_itr = cmd_line_.begin();
17*1a96fba6SXin Li        cmd_itr != cmd_line_.end();
18*1a96fba6SXin Li        cmd_itr++) {
19*1a96fba6SXin Li     if (result.length()) {
20*1a96fba6SXin Li       result.append(" ");
21*1a96fba6SXin Li     }
22*1a96fba6SXin Li     result.append((*cmd_itr));
23*1a96fba6SXin Li   }
24*1a96fba6SXin Li   return result;
25*1a96fba6SXin Li }
26*1a96fba6SXin Li 
27*1a96fba6SXin Li }  // namespace brillo
28