Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: cloud_print/gcp20/prototype/dns_txt_builder.cc

Issue 16975004: Finished DNS-SD server. Finished Privet-specified DNS-SD server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Lint errors. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+}
+

Powered by Google App Engine
This is Rietveld 408576698