1 : // Copyright 2012 Google Inc.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Defines member function for a generic application implementation base
16 : // class (empty implementation).
17 :
18 : #include "syzygy/common/application.h"
19 :
20 : #include "base/file_path.h"
21 : #include "base/file_util.h"
22 :
23 : namespace common {
24 :
25 : AppImplBase::AppImplBase(const base::StringPiece& name)
26 E : : in_(stdin), out_(stdout), err_(stderr) {
27 E : name_.assign(name.begin(), name.end());
28 E : }
29 :
30 E : bool AppImplBase::ParseCommandLine(const CommandLine* command_line) {
31 E : return true;
32 E : }
33 :
34 E : bool AppImplBase::SetUp() {
35 E : return true;
36 E : }
37 :
38 E : int AppImplBase::Run() {
39 E : return 0;
40 E : }
41 :
42 E : void AppImplBase::TearDown() {
43 E : }
44 :
45 E : FilePath AppImplBase::AbsolutePath(const FilePath& path) {
46 E : if (path.empty())
47 E : return FilePath();
48 :
49 E : FilePath temp(path);
50 E : if (file_util::AbsolutePath(&temp))
51 E : return temp;
52 : else
53 i : return path;
54 E : }
55 :
56 : } // namespace common
|