Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:18:50+00:00 2026-05-31T00:18:50+00:00

I have a simple regex conversion method that I use to do some minor

  • 0

I have a simple regex conversion method that I use to do some minor processing to HTML passed in as a std::string. The method looks like:

std::string ParseQuotedPrintableHtml( std::string const& html );

I want to design this method into some sort of small library that can be used across my whole code base. Since it’s just a single function, one might be tempted to just create a Utility class (or namespace) and stuff the function in there. I feel this is a bit of a naive design. Any suggestions on a good rule of thumb as to how to design functionality like this into a centralized and accessible location?

EDIT

I should also mention that there are several “helper” functions that this function calls (I also created these, and they are only useful to and used by this method). Ideally these would be “private” in a class, but if I keep this as a global function, those implementation methods will also be accessible in the global namespace (or whichever namespace I place them in).

I guess due to this, it’s best to create a utility class maybe?

class QuotedPrintableHtml
{
  private:
    void HelperMethod1() const;
    void HelperMethod2() const;

    std::string html_;

  public:
    QuotedPrintableHtml( std::string const& html ) : html_(html) {}
    std::string Parse() const;
};

Perhaps something like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:18:52+00:00Added an answer on May 31, 2026 at 12:18 am

    I wouldn’t advise creating a class: the utility functions don’t share some state so I would just create a namespace like Utilities to collect those free functions. You can put all the helper functions you don’t want to share in an anonymous namespace inside your cpp file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A quick simple regex question I have a domain name in a string that
I have a regex 'simple' that I'd like to use as a building block
I have this simple regex, [\d]{1,5} that matches any integer between 0 and 99999.
Simple regex question. I have a string on the following format: this is a
Let's say I have two strings like this: XABY XBAY A simple regex that
If I have a simple regex pattern like ab. and I have a string
I have a simple problem: I want to construct a regex that matches a
I have a string on which I try to create a regex mask that
I have simple regex for parsing this string: rawresp0 = <response> <comment>Привет.</comment> </response> I
I have simple regex \.*\ for me its says select everything between and ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.