2N/A/* -*- Mode: Java; tab-width: 4 -*- 2N/A * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. 2N/A * Licensed under the Apache License, Version 2.0 (the "License"); 2N/A * you may not use this file except in compliance with the License. 2N/A * You may obtain a copy of the License at 2N/A * Unless required by applicable law or agreed to in writing, software 2N/A * distributed under the License is distributed on an "AS IS" BASIS, 2N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2N/A * See the License for the specific language governing permissions and 2N/A * limitations under the License. 2N/A Change History (most recent first): 2N/ARevision 1.6 2006/08/14 23:25:08 cheshire 2N/ARe-licensed mDNSResponder daemon source code under Apache License, Version 2.0 2N/ARevision 1.5 2004/08/25 21:54:36 rpantos 2N/A<rdar://problem/3773973> Fix getValue() for values containing '='. 2N/ARevision 1.4 2004/08/04 01:04:50 rpantos 2N/A<rdar://problems/3731579&3731582> Fix set(); add remove() & toString(). 2N/ARevision 1.3 2004/07/13 21:24:25 rpantos 2N/AFix for <rdar://problem/3701120>. 2N/ARevision 1.2 2004/04/30 21:48:27 rpantos 2N/AChange line endings for CVS. 2N/ARevision 1.1 2004/04/30 16:29:35 rpantos 2N/Aident "%Z%%M% %I% %E% SMI" 2N/A - implement remove() 2N/A - fix set() to replace existing values 2N/A Object used to construct and parse DNS-SD format TXT records. 2N/A DNS-SD specifies that a TXT record corresponding to an SRV record consist of 2N/A a packed array of bytes, each preceded by a length byte. Each string 2N/A is an attribute-value pair. 2N/A The TXTRecord object stores the entire TXT data as a single byte array, traversing it 2N/A as need be to implement its various methods. 2N/A /** Constructs a new, empty TXT record. */ 2N/A /** Constructs a new TXT record from a byte array in the standard format. */ 2N/A /** Set a key/value pair in the TXT record. Setting an existing key will replace its value.<P> 2N/A The key name. Must be ASCII, with no '=' characters. 2N/A Value to be encoded into bytes using the default platform character set. 2N/A /** Set a key/value pair in the TXT record. Setting an existing key will replace its value.<P> 2N/A The key name. Must be ASCII, with no '=' characters. 2N/A Binary representation of the value. 2N/A // Insert a key-value pair at index 2N/A // locate the insertion point 2N/A /** Remove a key/value pair from the TXT record. Returns index it was at, or -1 if not found. */ 2N/A /** Return the number of keys in the TXT record. */ 2N/A /** Return true if key is present in the TXT record, false if not. */ 2N/A /** Return a key in the TXT record by zero-based index. Returns null if index exceeds the total number of keys. */ 2N/A Look up a key in the TXT record by zero-based index and return its value. <P> 2N/A Returns null if index exceeds the total number of keys. 2N/A Returns null if the key is present with no value. 2N/A /** Converts the result of getValue() to a string in the platform default character set. */ 2N/A /** Get the value associated with a key. Will be null if the key is not defined. 2N/A Array will have length 0 if the key is defined with an = but no value.<P> 2N/A The left-hand side of the key-value pair. 2N/A @return The binary representation of the value. 2N/A /** Converts the result of getValue() to a string in the platform default character set.<P> 2N/A The left-hand side of the key-value pair. 2N/A @return The value represented in the default platform character set. 2N/A /** Return the contents of the TXT record as raw bytes. */ 2N/A /** Return a string representation of the object. */