00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "base/basictypes.h"
00015 #include "base/stringpiece.h"
00016 #include "base/stringprintf.h"
00017
00018 namespace operations_research {
00019
00020
00021 std::string StrCat(const StringPiece& p1, const StringPiece& p2) {
00022 std::string result = p1.ToString();
00023 result += p2.ToString();
00024 return result;
00025 }
00026
00027 std::string StrCat(const StringPiece& p1,
00028 const StringPiece& p2,
00029 const StringPiece& p3) {
00030 std::string result = p1.ToString();
00031 result += p2.ToString();
00032 result += p3.ToString();
00033 return result;
00034 }
00035
00036 std::string StrCat(const StringPiece& p1,
00037 const StringPiece& p2,
00038 const StringPiece& p3,
00039 const StringPiece& p4) {
00040 std::string result = p1.ToString();
00041 result += p2.ToString();
00042 result += p3.ToString();
00043 result += p4.ToString();
00044 return result;
00045 }
00046
00047 std::string StrCat(const StringPiece& p1,
00048 const StringPiece& p2,
00049 const StringPiece& p3,
00050 const StringPiece& p4,
00051 const StringPiece& p5) {
00052 std::string result = p1.ToString();
00053 result += p2.ToString();
00054 result += p3.ToString();
00055 result += p4.ToString();
00056 result += p5.ToString();
00057 return result;
00058 }
00059
00060 std::string StrCat(int64 a1, const StringPiece& p2) {
00061 return StringPrintf("%lld%s", a1, p2.ToString().c_str());
00062 }
00063
00064 std::string StrCat(const StringPiece& p1, int64 a2) {
00065 return StringPrintf("%s%lld", p1.ToString().c_str(), a2);
00066 }
00067
00068 }