<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi.<div>It looks like your task should be relatively easy since you have the full definition of the UniString and the SharedBuffer.</div><div>I am assuming you will want to show the string content as your summary (as it happens for std::string and NSString).</div><div>If so, how are you going to use the string buffer? Is it going to contain a pointer to the real data?</div><div>I am probably slightly confused by your comment next to it.</div><div>Could you explain the logic for storing the string data or provide an example of code that handles e.g. the string allocation, or access to it?</div><div>Given that understanding, it should be relatively straightforward to accomplish your task.</div><div><br><div>
<div><div style="border-collapse: separate; border-spacing: 0px; "><i>Enrico Granata</i></div><div style="border-collapse: separate; border-spacing: 0px; ">✉ egranata@<font class="Apple-style-span" color="#ff230e"></font>.com</div><div>✆ (408) 972-7683</div></div>
</div>
<br><div><div>On Dec 10, 2012, at 7:35 AM, "Somorjai, Akos" <<a href="mailto:ASomorjai@graphisoft.com">ASomorjai@graphisoft.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello everyone,<br><br>I need a little help with a custom formatter for the class below; I'd appreciate if someone could throw together a skeleton I can start from.<br><br>Thanks,<br><br>Akos<br><br><br>Here's the class layout:<br><br>class UniString {<br><br>private:<br><span class="Apple-tab-span" style="white-space:pre">        </span>struct SharedBuffer;<br><br><span class="Apple-tab-span" style="white-space:pre">    </span>SharedBuffer*<span class="Apple-tab-span" style="white-space:pre">       </span>content;<span class="Apple-tab-span" style="white-space:pre">    </span>// shared buffer storing content of the string<br><br><span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>// Implementation classes and structures<br><br><span class="Apple-tab-span" style="white-space:pre">        </span>struct SharedBuffer {<br><span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>USize<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>length;<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>// length of the string in UniChar::Layout units<br><span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>USize<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>capacity;<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>// capacity of the allocated buffer in UniChar::Layout units<br><span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>SInt32<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>refCounter;<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>// stores number of references to this shared buffer<br><span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>char<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>reserved[2];<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>// padding reserved for the future use<br><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>unichar<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>string[1];<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>// buffer storing content of the string (extends beyond of the SharedBuffer)<br><br><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>inline SharedBuffer ();<br><span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>inline SharedBuffer (USize initialLength, USize initialCapacity, Int32 initialRefCounter);<br><span class="Apple-tab-span" style="white-space:pre">        </span>};<br>…<br>};<br><br><br>_______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev<br></blockquote></div><br></div></body></html>