コード例 #1
0
int main()
{
  PString *p = initializeString(30);
  strcpy(p->chars, "Hello");
  printf("%d\n", p->length(p));
  return 0;
}
コード例 #2
0
ファイル: hscroll.cpp プロジェクト: 33d/jy-mcu-3208
HScrollEffect::HScrollEffect(Display& display, const Font& font, const PString& text, bool blankAtEnd = true)
    : TextEffect(display, font, text), blankAtEnd(blankAtEnd), pos(0), charCol(0) {
    // The length, including the blank space at the end (if requested)
    maxPos = blankAtEnd ? text.length() + 1 : text.length();
    glyph_width = font.char_width(text[pos]);
}