Commit 23bc0e33 authored by Marco De Marco's avatar Marco De Marco
Browse files

Request response modified

parent d999293c
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -26,9 +26,8 @@ message Request
	
	message Data
	{
		required string file_path = 1;
		required int32 file_version = 2;
		required string file_name = 3;
		required int32 file_version = 1;
		required string file_name = 2;
	}

	optional Data data = 3;
+4 −1
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ message Response
		required State state = 1;
		required string status = 2;

		required uint64 size = 3;
		required string file_path = 3;
		required string file_version = 4;
		required string file_name = 5;
		required uint64 size = 6;
	}
}
+20 −78
Original line number Diff line number Diff line
@@ -74,8 +74,7 @@ void protobuf_AssignDesc_Request_2eproto() {
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(Request_Authorization));
  Request_Data_descriptor_ = Request_descriptor_->nested_type(1);
  static const int Request_Data_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, file_path_),
  static const int Request_Data_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, file_version_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Request_Data, file_name_),
  };
@@ -129,15 +128,15 @@ void protobuf_AddDesc_Request_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\rRequest.proto\022\017DataExporter_ns\"\300\002\n\007Req"
    "\n\rRequest.proto\022\017DataExporter_ns\"\255\002\n\007Req"
    "uest\022+\n\004type\030\001 \002(\0162\035.DataExporter_ns.Req"
    "uest.Type\022=\n\rauthorization\030\002 \001(\0132&.DataE"
    "xporter_ns.Request.Authorization\022+\n\004data"
    "\030\003 \001(\0132\035.DataExporter_ns.Request.Data\0323\n"
    "\rAuthorization\022\020\n\010username\030\001 \002(\t\022\020\n\010pass"
    "word\030\002 \002(\t\032B\n\004Data\022\021\n\tfile_path\030\001 \002(\t\022\024\n"
    "\014file_version\030\002 \002(\005\022\021\n\tfile_name\030\003 \002(\t\"#"
    "\n\004Type\022\021\n\rAUTHORIZATION\020\000\022\010\n\004DATA\020\001", 355);
    "word\030\002 \002(\t\032/\n\004Data\022\024\n\014file_version\030\001 \002(\005"
    "\022\021\n\tfile_name\030\002 \002(\t\"#\n\004Type\022\021\n\rAUTHORIZA"
    "TION\020\000\022\010\n\004DATA\020\001", 336);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "Request.proto", &protobuf_RegisterTypes);
  Request::default_instance_ = new Request();
@@ -463,7 +462,6 @@ void Request_Authorization::Swap(Request_Authorization* other) {
// -------------------------------------------------------------------

#ifndef _MSC_VER
const int Request_Data::kFilePathFieldNumber;
const int Request_Data::kFileVersionFieldNumber;
const int Request_Data::kFileNameFieldNumber;
#endif  // !_MSC_VER
@@ -484,7 +482,6 @@ Request_Data::Request_Data(const Request_Data& from)

void Request_Data::SharedCtor() {
  _cached_size_ = 0;
  file_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
  file_version_ = 0;
  file_name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
@@ -495,9 +492,6 @@ Request_Data::~Request_Data() {
}

void Request_Data::SharedDtor() {
  if (file_path_ != &::google::protobuf::internal::kEmptyString) {
    delete file_path_;
  }
  if (file_name_ != &::google::protobuf::internal::kEmptyString) {
    delete file_name_;
  }
@@ -528,11 +522,6 @@ Request_Data* Request_Data::New() const {

void Request_Data::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_file_path()) {
      if (file_path_ != &::google::protobuf::internal::kEmptyString) {
        file_path_->clear();
      }
    }
    file_version_ = 0;
    if (has_file_name()) {
      if (file_name_ != &::google::protobuf::internal::kEmptyString) {
@@ -550,27 +539,10 @@ bool Request_Data::MergePartialFromCodedStream(
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required string file_path = 1;
      // required int32 file_version = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_file_path()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
            this->file_path().data(), this->file_path().length(),
            ::google::protobuf::internal::WireFormat::PARSE);
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_file_version;
        break;
      }

      // required int32 file_version = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_file_version:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &file_version_)));
@@ -578,12 +550,12 @@ bool Request_Data::MergePartialFromCodedStream(
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(26)) goto parse_file_name;
        if (input->ExpectTag(18)) goto parse_file_name;
        break;
      }

      // required string file_name = 3;
      case 3: {
      // required string file_name = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_file_name:
@@ -617,27 +589,18 @@ bool Request_Data::MergePartialFromCodedStream(

void Request_Data::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // required string file_path = 1;
  if (has_file_path()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
      this->file_path().data(), this->file_path().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE);
    ::google::protobuf::internal::WireFormatLite::WriteString(
      1, this->file_path(), output);
  }

  // required int32 file_version = 2;
  // required int32 file_version = 1;
  if (has_file_version()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->file_version(), output);
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->file_version(), output);
  }

  // required string file_name = 3;
  // required string file_name = 2;
  if (has_file_name()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
      this->file_name().data(), this->file_name().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE);
    ::google::protobuf::internal::WireFormatLite::WriteString(
      3, this->file_name(), output);
      2, this->file_name(), output);
  }

  if (!unknown_fields().empty()) {
@@ -648,29 +611,19 @@ void Request_Data::SerializeWithCachedSizes(

::google::protobuf::uint8* Request_Data::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // required string file_path = 1;
  if (has_file_path()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
      this->file_path().data(), this->file_path().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE);
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->file_path(), target);
  }

  // required int32 file_version = 2;
  // required int32 file_version = 1;
  if (has_file_version()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->file_version(), target);
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->file_version(), target);
  }

  // required string file_name = 3;
  // required string file_name = 2;
  if (has_file_name()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
      this->file_name().data(), this->file_name().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE);
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        3, this->file_name(), target);
        2, this->file_name(), target);
  }

  if (!unknown_fields().empty()) {
@@ -684,21 +637,14 @@ int Request_Data::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required string file_path = 1;
    if (has_file_path()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->file_path());
    }

    // required int32 file_version = 2;
    // required int32 file_version = 1;
    if (has_file_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->file_version());
    }

    // required string file_name = 3;
    // required string file_name = 2;
    if (has_file_name()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
@@ -732,9 +678,6 @@ void Request_Data::MergeFrom(const ::google::protobuf::Message& from) {
void Request_Data::MergeFrom(const Request_Data& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_file_path()) {
      set_file_path(from.file_path());
    }
    if (from.has_file_version()) {
      set_file_version(from.file_version());
    }
@@ -758,14 +701,13 @@ void Request_Data::CopyFrom(const Request_Data& from) {
}

bool Request_Data::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;

  return true;
}

void Request_Data::Swap(Request_Data* other) {
  if (other != this) {
    std::swap(file_path_, other->file_path_);
    std::swap(file_version_, other->file_version_);
    std::swap(file_name_, other->file_name_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
+13 −98
Original line number Diff line number Diff line
@@ -215,29 +215,17 @@ class Request_Data : public ::google::protobuf::Message {

  // accessors -------------------------------------------------------

  // required string file_path = 1;
  inline bool has_file_path() const;
  inline void clear_file_path();
  static const int kFilePathFieldNumber = 1;
  inline const ::std::string& file_path() const;
  inline void set_file_path(const ::std::string& value);
  inline void set_file_path(const char* value);
  inline void set_file_path(const char* value, size_t size);
  inline ::std::string* mutable_file_path();
  inline ::std::string* release_file_path();
  inline void set_allocated_file_path(::std::string* file_path);

  // required int32 file_version = 2;
  // required int32 file_version = 1;
  inline bool has_file_version() const;
  inline void clear_file_version();
  static const int kFileVersionFieldNumber = 2;
  static const int kFileVersionFieldNumber = 1;
  inline ::google::protobuf::int32 file_version() const;
  inline void set_file_version(::google::protobuf::int32 value);

  // required string file_name = 3;
  // required string file_name = 2;
  inline bool has_file_name() const;
  inline void clear_file_name();
  static const int kFileNameFieldNumber = 3;
  static const int kFileNameFieldNumber = 2;
  inline const ::std::string& file_name() const;
  inline void set_file_name(const ::std::string& value);
  inline void set_file_name(const char* value);
@@ -248,8 +236,6 @@ class Request_Data : public ::google::protobuf::Message {

  // @@protoc_insertion_point(class_scope:DataExporter_ns.Request.Data)
 private:
  inline void set_has_file_path();
  inline void clear_has_file_path();
  inline void set_has_file_version();
  inline void clear_has_file_version();
  inline void set_has_file_name();
@@ -257,12 +243,11 @@ class Request_Data : public ::google::protobuf::Message {

  ::google::protobuf::UnknownFieldSet _unknown_fields_;

  ::std::string* file_path_;
  ::std::string* file_name_;
  ::google::protobuf::int32 file_version_;

  mutable int _cached_size_;
  ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];

  friend void  protobuf_AddDesc_Request_2eproto();
  friend void protobuf_AssignDesc_Request_2eproto();
@@ -555,85 +540,15 @@ inline void Request_Authorization::set_allocated_password(::std::string* passwor

// Request_Data

// required string file_path = 1;
inline bool Request_Data::has_file_path() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Request_Data::set_has_file_path() {
  _has_bits_[0] |= 0x00000001u;
}
inline void Request_Data::clear_has_file_path() {
  _has_bits_[0] &= ~0x00000001u;
}
inline void Request_Data::clear_file_path() {
  if (file_path_ != &::google::protobuf::internal::kEmptyString) {
    file_path_->clear();
  }
  clear_has_file_path();
}
inline const ::std::string& Request_Data::file_path() const {
  return *file_path_;
}
inline void Request_Data::set_file_path(const ::std::string& value) {
  set_has_file_path();
  if (file_path_ == &::google::protobuf::internal::kEmptyString) {
    file_path_ = new ::std::string;
  }
  file_path_->assign(value);
}
inline void Request_Data::set_file_path(const char* value) {
  set_has_file_path();
  if (file_path_ == &::google::protobuf::internal::kEmptyString) {
    file_path_ = new ::std::string;
  }
  file_path_->assign(value);
}
inline void Request_Data::set_file_path(const char* value, size_t size) {
  set_has_file_path();
  if (file_path_ == &::google::protobuf::internal::kEmptyString) {
    file_path_ = new ::std::string;
  }
  file_path_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* Request_Data::mutable_file_path() {
  set_has_file_path();
  if (file_path_ == &::google::protobuf::internal::kEmptyString) {
    file_path_ = new ::std::string;
  }
  return file_path_;
}
inline ::std::string* Request_Data::release_file_path() {
  clear_has_file_path();
  if (file_path_ == &::google::protobuf::internal::kEmptyString) {
    return NULL;
  } else {
    ::std::string* temp = file_path_;
    file_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
    return temp;
  }
}
inline void Request_Data::set_allocated_file_path(::std::string* file_path) {
  if (file_path_ != &::google::protobuf::internal::kEmptyString) {
    delete file_path_;
  }
  if (file_path) {
    set_has_file_path();
    file_path_ = file_path;
  } else {
    clear_has_file_path();
    file_path_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
  }
}

// required int32 file_version = 2;
// required int32 file_version = 1;
inline bool Request_Data::has_file_version() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
  return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void Request_Data::set_has_file_version() {
  _has_bits_[0] |= 0x00000002u;
  _has_bits_[0] |= 0x00000001u;
}
inline void Request_Data::clear_has_file_version() {
  _has_bits_[0] &= ~0x00000002u;
  _has_bits_[0] &= ~0x00000001u;
}
inline void Request_Data::clear_file_version() {
  file_version_ = 0;
@@ -647,15 +562,15 @@ inline void Request_Data::set_file_version(::google::protobuf::int32 value) {
  file_version_ = value;
}

// required string file_name = 3;
// required string file_name = 2;
inline bool Request_Data::has_file_name() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
  return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void Request_Data::set_has_file_name() {
  _has_bits_[0] |= 0x00000004u;
  _has_bits_[0] |= 0x00000002u;
}
inline void Request_Data::clear_has_file_name() {
  _has_bits_[0] &= ~0x00000004u;
  _has_bits_[0] &= ~0x00000002u;
}
inline void Request_Data::clear_file_name() {
  if (file_name_ != &::google::protobuf::internal::kEmptyString) {
+190 −15

File changed.

Preview size limit exceeded, changes collapsed.

Loading