OSDN Git Service

idmap2: move commands to Result<Unit>
authorMårten Kongstad <marten.kongstad@sony.com>
Thu, 7 Feb 2019 01:21:56 +0000 (02:21 +0100)
committerTodd Kennedy <toddke@google.com>
Tue, 19 Mar 2019 21:26:38 +0000 (14:26 -0700)
commit0c6ff1da4f20da59b6bb8649429142390c636743
treee56e9111d6f7c37c9d106e010f78268e4d7a7bc0
parent09eb96c4c7874f06bc71d084b7d51eac26779b52
idmap2: move commands to Result<Unit>

Change the signature of the idmap2 commands (Create, Dump, ...) to
return Result<Unit> instead of bool. This removes the need to pass in an
ostream for error messages: instead, those messages are part of the
returned Result.

Consolidate error messages: texts in Error objects should not be
prefixed with "error:", that is the responsibility of the outer-most
caller (i.e. main()).

Test: make idmap2_tests
Change-Id: I074881b3d1982ea8f4be5752161ac74b14fcba95
14 files changed:
cmds/idmap2/idmap2/Commands.h
cmds/idmap2/idmap2/Create.cpp
cmds/idmap2/idmap2/Dump.cpp
cmds/idmap2/idmap2/Lookup.cpp
cmds/idmap2/idmap2/Main.cpp
cmds/idmap2/idmap2/Scan.cpp
cmds/idmap2/idmap2/Verify.cpp
cmds/idmap2/idmap2d/Idmap2Service.cpp
cmds/idmap2/include/idmap2/CommandLineOptions.h
cmds/idmap2/include/idmap2/Idmap.h
cmds/idmap2/libidmap2/CommandLineOptions.cpp
cmds/idmap2/libidmap2/Idmap.cpp
cmds/idmap2/tests/CommandLineOptionsTests.cpp
cmds/idmap2/tests/IdmapTests.cpp