winix/templates/mount.cpp

61 lines
1.0 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "templates.h"
#include "core/misc.h"
namespace TemplatesFunctions
{
void mount_type_is(Info & i)
{
int mount_type_id = system->mounts.FindMountType(i.par);
if( mount_type_id == -1 )
return;
i.res = (system->mounts.pmount->type == mount_type_id);
}
void mount_page_arg_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(system->mounts.MountParPage(), i.par);
}
void mount_thread_arg_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(system->mounts.MountParThread(), i.par);
}
void mount_has_html_template(Info & i)
{
i.res = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()].defined;
}
void mount_first_html_template(Info & i)
{
Mount::ParamRow & par = system->mounts.pmount->param[system->mounts.MountParHtmlTemplate()];
if( par.defined && !par.arg.empty() )
i.out << par.arg[0];
}
} // namespace TemplatesFunctions