Exemplo n.º 1
0
int basicAnonymizer( gdcm::File *file ) {
    gdcm::DataSet &ds = file->GetDataSet();

    // sanity checks
    static const gdcm::Tag Att1 = gdcm::Tag(0x0400, 0x0500), Att2 = gdcm::Tag(0x0012, 0x0062), Att3 = gdcm::Tag(0x0012, 0x0063);
    if ( ds.FindDataElement( Att1 ) || ds.FindDataElement( Att2 ) || ds.FindDataElement( Att3 ) ) { return 0; }

    recurseDataSet( ds, *file );

    replaceTag( gdcm::Tag(0x0012, 0x0062), "YES", ds );
    replaceTag( gdcm::Tag(0x0012, 0x0063), "BASIC APPLICATION LEVEL CONFIDENTIALITY PROFILE", ds );
    
    return 1;
}
Exemplo n.º 2
0
	void MTD_FLASHMEM ParameterReplacer::processInput()
	{
		char const* curc  = m_strStart;
		char const* start = curc;
		char const* curBlockKey      = NULL;
		char const* curBlockKeyEnd   = NULL;
		while (curc != m_strEnd)
		{
			char c0 = getChar(curc);
			if (c0 == '{')
			{
				char c1 = getChar(curc + 1);
				if (c1 == '{')
				{
					// found "{{"
					// push previous content
					m_result.addChunk(start, curc - start, false);
					// process parameter tag
					start = curc = replaceTag(curc);
					continue;
				}
				else if (c1 == '%')
				{
					// found "{%"
					// push previous content
					if (curBlockKey && curBlockKeyEnd)
					{
						m_result.addChunk(start, curc - start, false);
						m_blocks.add(curBlockKey, curBlockKeyEnd, m_result);
						m_result.clear();
					}
					// process block tag
					curBlockKey = extractTagStr(curc, &curBlockKeyEnd);
					start = curc = curBlockKeyEnd + 2;	// bypass "%}"
					// if this is the first block tag then this is the template file name
					if (m_template.get() == NULL)
					{
						m_template.reset(f_strdup(curBlockKey, curBlockKeyEnd));
						curBlockKey = NULL;
						curBlockKeyEnd = NULL;
					}
					continue;
				}
			}
			++curc;
		}
		m_result.addChunk(start, m_strEnd - start, false);
		if (curBlockKey && curBlockKeyEnd)
		{
			m_blocks.add(curBlockKey, curBlockKeyEnd, m_result);
			m_result.clear();
		}			
	}
Exemplo n.º 3
0
void MutableSong::setAlbum(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_ALBUM, Song::getAlbum(idx), value, idx);
}
Exemplo n.º 4
0
void MutableSong::setTitle(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_TITLE, Song::getTitle(idx), value, idx);
}
Exemplo n.º 5
0
void MutableSong::setArtist(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_ARTIST, Song::getArtist(idx), value, idx);
}
Exemplo n.º 6
0
void MutableSong::setComment(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_COMMENT, Song::getComment(idx), value, idx);
}
Exemplo n.º 7
0
void MutableSong::setDisc(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_DISC, Song::getDisc(idx), value, idx);
}
Exemplo n.º 8
0
void MutableSong::setPerformer(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_PERFORMER, Song::getPerformer(idx), value, idx);
}
Exemplo n.º 9
0
void MutableSong::setComposer(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_COMPOSER, Song::getComposer(idx), value, idx);
}
Exemplo n.º 10
0
void MutableSong::setGenre(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_GENRE, Song::getGenre(idx), value, idx);
}
Exemplo n.º 11
0
void MutableSong::setDate(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_DATE, Song::getDate(idx), value, idx);
}
Exemplo n.º 12
0
void MutableSong::setTrack(const std::string &value, unsigned idx)
{
	replaceTag(MPD_TAG_TRACK, Song::getTrack(idx), value, idx);
}
Exemplo n.º 13
0
void QueryBuilder::bindParam(std::string tag, std::string value)
{
    replaceTag(tag, value);
}
Exemplo n.º 14
0
void QueryBuilder::bind(std::string tag, float value)
{
    replaceTag(tag, std::to_string(value));
}
Exemplo n.º 15
0
void QueryBuilder::bind(std::string tag, std::string value)
{
    escape(value);
    addQuotes(value);
    replaceTag(tag, value);
}