Index: cloud_print/gcp20/prototype/dns_txt_builder.cc |
diff --git a/cloud_print/gcp20/prototype/dns_txt_builder.cc b/cloud_print/gcp20/prototype/dns_txt_builder.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0920c03de4a465f0fb0f468c631c79f6200bceef |
--- /dev/null |
+++ b/cloud_print/gcp20/prototype/dns_txt_builder.cc |
@@ -0,0 +1,22 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "cloud_print/gcp20/prototype/dns_txt_builder.h" |
+ |
+#include <string.h> |
+ |
+#include "base/logging.h" |
+#include "base/strings/string_piece.h" |
+ |
+void DnsTxtBuilder::AddRecord(const char* str) { |
+ int len = strlen(str); |
+ DCHECK_LT(len, 256); |
+ record += static_cast<char>(len); // Set length byte. |
+ record += str; |
+} |
+ |
+std::string DnsTxtBuilder::Build() const { |
+ return record; |
+} |
+ |