MCPcopy Create free account
hub / github.com/TortoiseGit/TortoiseGit / Load

Method Load

src/TortoiseProc/VersioncheckParser.cpp:78–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78bool CVersioncheckParser::Load(const CString& filename, CString& err)
79{
80 m_versioncheckfile.LoadFile(filename);
81
82 m_version.version = GetStringValue(L"tortoisegit", L"version");
83 if (m_version.version.IsEmpty())
84 {
85 err = L"Invalid version check file.";
86 return false;
87 }
88 unsigned __int64 version = 0;
89 CString vertemp = m_version.version;
90 m_version.major = _ttoi(vertemp);
91 vertemp = vertemp.Mid(vertemp.Find(L'.') + 1);
92 m_version.minor = _ttoi(vertemp);
93 vertemp = vertemp.Mid(vertemp.Find(L'.') + 1);
94 m_version.micro = _ttoi(vertemp);
95 vertemp = vertemp.Mid(vertemp.Find(L'.') + 1);
96 m_version.build = _ttoi(vertemp);
97 version = m_version.major;
98 version <<= 16;
99 version += m_version.minor;
100 version <<= 16;
101 version += m_version.micro;
102 version <<= 16;
103 version += m_version.build;
104
105 if (version == 0)
106 {
107 err = L"Invalid version check file.";
108 return false;
109 }
110
111 // another versionstring for the filename can be provided
112 // this is needed for preview releases
113 m_version.version_for_filename = GetStringValue(L"tortoisegit", L"versionstring");
114 if (m_version.version_for_filename.IsEmpty())
115 m_version.version_for_filename = m_version.version;
116 m_version.version_languagepacks = GetStringValue(L"tortoisegit", L"versionstringlanguagepacks");
117 if (m_version.version_languagepacks.IsEmpty())
118 m_version.version_languagepacks = m_version.version;
119
120 return true;
121}
122
123CVersioncheckParser::Version CVersioncheckParser::GetTortoiseGitVersion()
124{

Callers 10

OnInitDialogMethod · 0.45
OnInitDialogMethod · 0.45
CheckThreadMethod · 0.45
OnPaintMethod · 0.45
ReloadHistoryEntriesMethod · 0.45
OnInitDialogMethod · 0.45
ReloadHistoryEntriesMethod · 0.45
OnInitDialogMethod · 0.45
InitInstanceMethod · 0.45
OnInitDialogMethod · 0.45

Calls 3

LoadFileMethod · 0.80
IsEmptyMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected