473,513 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Template Engine

4 New Member
Hello! I need a C++ template engine like Smarty. There is some html file with keywords and symbols, you need the program to read this file, replace these words with necessary actions (for example, you need to extract data from the database) and output the finished html file without any unnecessary symbols. Please HELP!
Apr 22 '17 #1
7 2038
weaknessforcats
9,208 Recognized Expert Moderator Expert
Do you know how C++ templates work?
Apr 22 '17 #2
Mikel SA
4 New Member
No, if you mean something different from what I'm looking for
Apr 22 '17 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
A C++ template is code with no types.

Expand|Select|Wrap|Line Numbers
  1. <template>
  2. T func(T* x)
  3. {
  4.     return x;
  5. }
In your code you say:

Expand|Select|Wrap|Line Numbers
  1. int Z = 10;
  2. int a = func<int>(&Z);
The preprocessor hands this to the compiler:

Expand|Select|Wrap|Line Numbers
  1. int funcABCDintxxxx(int* x)
  2. {
  3.     return x;
  4. }
  5.  
  6. int Z = 10;
  7.     funcABCDintxxxx(&Z);
  8.  
The funcABCDintxxxx is the result of the mangler which is C++ system library code used to obtain a unique name from some not unique input.

So you will have one func for every type you used. The alternative is you coming up with unique names for identical code.

Is this what you are looking for?
Apr 22 '17 #4
Mikel SA
4 New Member
I suppose no! But could you give a code of this C++ template library.
Generally I need the program to read the html file with some key symbols and words, process these keywords and output a full html file without any keywords or key symbols.

If you want I can show you a screen of initial state of html file and a screen of output state of html file?
Apr 22 '17 #5
weaknessforcats
9,208 Recognized Expert Moderator Expert
Because the templates are in text and your code is in text everyone can see the templates. They are public domain.

Just query the Internet for C++ Template Library
Apr 23 '17 #6
Mikel SA
4 New Member
Actually I need something like Django (Python framework) but C++ variant, which doesn't have any own server and db, just html corrector, IDK. Sometimes its called template language
Apr 23 '17 #7
weaknessforcats
9,208 Recognized Expert Moderator Expert
At least you know that C++ is not your answer.
Apr 23 '17 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2197
by: Don Sutter | last post by:
Hello, I'm looking for "Template" recomendations for PHP 4, like which one is popular or has the best/most features. I'm somewhat of a newbie with PHP and bacame interested in templates via...
5
2256
by: Miika Keskinen | last post by:
Hi all I was in need for a simple template engine (like PEAR::IT.php) and didn't find any suitable. Yes, there is many templating engines available but most are far too complex or does implement...
1
1607
by: Wensheng | last post by:
Hi, I wrote a small template engine called spytee. Like any template enigne, it take a text(html) template file as input, process the variable tags in the file, and display the resulted text. The...
8
2513
by: HchC | last post by:
PHP is already a HTML templating laguage, but I am looking for a HTML template engine for users who know nothing about HTML. This template engine should not be too complex, as this is for very...
2
9433
by: Laurens | last post by:
Hi, Does anyone know a good template engine for generating text dynamically. (I.e. HTML, SQL statements, code generation, etc.) I'm looking for something similar to Velocity or Freemarker(both...
4
1291
by: piotr | last post by:
Hi, I'm looking for a template engine that can give me names of required variables in parse time. Calculation of a value for a specific variable name could be possibly done in specified...
17
3201
by: allen.fowler | last post by:
Hello, Can anyone recommend a simple python template engine for generating HTML that relies only on the Pyhon Core modules? No need for caching, template compilation, etc. Speed is not a...
0
989
by: Samuel | last post by:
Hi, Following the masses I was drawn to RoR's website today and I saw the following HTML template in one of the screencasts: ------ <body> <% form_remote_tag :url ={ :action =:search },...
14
1553
by: Egbert Teeselink | last post by:
Hi all, The last few months I've worked on making a template engine because the ones out there didn't serve my needs. I guess everybody knows Smarty and has an opinion on it; I like many things...
1
1499
by: Primary Second | last post by:
Hello, First of all, I'm a bit new to OOP PHP. I'm currently creating a basic Template Engine. Everything is working fine until I want to load dynamic content (using a $var). Let me draw the...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.