MCPcopy Create free account
hub / github.com/audacity/audacity / WriteName

Method WriteName

libraries/lib-project-file-io/ProjectSerializer.cpp:472–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472void ProjectSerializer::WriteName(const wxString & name)
473{
474 wxASSERT(name.length() * sizeof(wxStringCharType) <= SHRT_MAX);
475 UShort id;
476
477 auto nameiter = mNames.find(name);
478 if (nameiter != mNames.end())
479 {
480 id = nameiter->second;
481 }
482 else
483 {
484 // mNames is static. This appends each name to static mDict only once
485 // in each run.
486 UShort len = name.length() * sizeof(wxStringCharType);
487
488 id = mNames.size();
489 mNames[name] = id;
490
491 mDict.AppendByte(FT_Name);
492 WriteUShort( mDict, id );
493 WriteUShort( mDict, len );
494 mDict.AppendData(name.wx_str(), len);
495
496 mDictChanged = true;
497 }
498
499 WriteUShort( mBuffer, id );
500}
501
502const MemoryStream &ProjectSerializer::GetDict() const
503{

Callers

nothing calls this directly

Calls 6

AppendByteMethod · 0.80
AppendDataMethod · 0.80
lengthMethod · 0.45
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected