Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. bool CheckProto(TConfig& config) {
  2.     const auto& descriptor = *config.GetDescriptor();
  3.     const auto& reflection = *config.GetReflection();
  4.  
  5.     for (int i = 0; i < descriptor.field_count(); ++i){
  6.         const auto& field = *descriptor.field(i);
  7.         if (field.is_required()) {
  8.             const bool key = field.options.GetExtension(NAlice::Required);
  9.             if (!key)
  10.                 return false;
  11.         }
  12.     }
  13.     return true;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement