Exemple #1
0
TEST(TStr, Trunc) {
	TStr Str = "   abcdef    ";
	TStr Str2 = "    ";
	TStr Str3 = "abcdef    ";
	TStr Str4 = "    abcdef";
	EXPECT_EQ(Str.GetTrunc(), "abcdef");
	EXPECT_EQ(Str2.GetTrunc(), TStr());	
	EXPECT_EQ(Str.ToTrunc(), "abcdef");
	EXPECT_EQ(Str2.ToTrunc(), TStr());
	EXPECT_EQ(Str3.ToTrunc(), "abcdef");
	EXPECT_EQ(Str4.ToTrunc(), "abcdef");
}
Exemple #2
0
TMovieTy TImdbNet::GetMovieTy(const TStr& MovieTyStr) {
  TStr LcStr = MovieTyStr.GetTrunc().GetLc();
  if (LcStr == "m") return mtyMovie;
  else if (LcStr == "tv") return mtyTv;
  else if (LcStr == "v") return mtyV;
  else if (LcStr == "vg") return mtyVg;
  else if (LcStr == "a") return mtyA;
  else if (LcStr == "scene") return mtyScene;
  else if (LcStr == "mini") return mtyMini;
  else if (LcStr == "archiv") return mtyArch;
  else if (LcStr == "voice") return mtyVoice;
  else if (LcStr == "singin") return mtySing;
  else if (LcStr == "als") return mtyAls;
  else if (LcStr == "episod") return mtyEpisod;
  else if (LcStr == "unconfirmed") return mtyUndef;
  printf("Unknown type: '%s'\n", LcStr.CStr());
  return mtyUndef;
}