Ejemplo n.º 1
0
bool
ProfileFileHasPassword(Path path)
{
  ProfileMap map;
  return Profile::LoadFile(map, path, IgnoreError()) &&
    map.Exists(ProfileKeys::Password);
}
Ejemplo n.º 2
0
TriState
ProfileFileHasPassword(Path path)
{
  ProfileMap map;

  try {
    Profile::LoadFile(map, path);
  } catch (const std::runtime_error &) {
    return TriState::UNKNOWN;
  }

  return map.Exists(ProfileKeys::Password)
    ? TriState::TRUE
    : TriState::FALSE;
}