Table of contents
1.
Introduction
2.
Classes
3.
Typedefs 
4.
Enums
5.
Functions
6.
Frequently Asked Questions
6.1.
What is ATL?
6.2.
What is COM?
6.3.
What is CPathT?
6.4.
What is CUrl?
6.5.
What is CThreadPool?
7.
Conclusion
Last Updated: Mar 27, 2024

ATL Utilities Reference

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hey Ninjas, this article is all about ATL utilities; it will act as a reference for them. But we will begin with knowing what ATL is. ATL stands for Active Template Library that supports vital COM features. COM is the Component Object Model, which Microsoft created as a distributed and platform-independent object-oriented system

Introductions

ATL also assists in manipulating paths and URLs in the form of CPathT class code and CUrl class code, respectively. We will see a list of more such utilities in this article.

Classes

Classes

Let us see the list of classes available in ATL utilities.

  • CPathT class: This ATL class represents a path.
     
  • CDebugReportHook class: We can use this class to send the debug reports to some named pipe.
     
  • CNonStatelessWorker class: This class receives requests from a thread pool and then passes them to a worker object. On each request, this worker object is created and destroyed.
     
  • CNoWorkerThread class: If we want to disable dynamic cache maintenance and cache classes, we use this class as the argument for the MonitorClass.
     
  • CThreadPool class: This provides a pool of worker threads that help with the processing of work item queues.
     
  • CUrl class: We use this ATL class to represent the URL. It allows us to manipulate each element of the URL independently from the other elements. It is useful in both cases, whether we are building a string from scratch or parsing an existing URL string. 
     
  • CWorkerThread class: We use this class to create a worker thread or use an existing one. This class waits on one or more kernel object handles, and after that, when one of the handles is signaled, it executes a specified client function.

Typedefs 

Typedefs

The C/C++ programming language provides a keyword named Typedef. We use these typedefs to redefine the names of existing datatypes. The typedefs of ATL utilities are: 

  • CPath: A specialization of the CPathT class using a CString.
     
  • CPathA: A specialization of the CPathT class using a CStringA.
     
  • CPathW: A specialization of the CPathT class using a CStringW.
     
  • ATL_URL_PORT: It is the type used by CUrl class to specify a port number.
     

Enums

Enums

The abbreviation Enum stands for Enumerations. Special data types or classes that represent a predefined set of constants. Through an enum, the programmer can set the value of a variable to these predefined constants. 

  • ATL_URL_SCHEME: The members of this enumeration provide constants for the schemes understood by CUrl.
     

Functions

Functions

The list of prominent functions in ATL Utilities are:  

  • AtlCanonicalizeUrl: We call this function to change a URL to a canonical form. Using this function, we can convert the unsafe spaces and characters into escape sequences.
     
  • AtlCombineUrl: We call this function for combining a base URL and a relative URL into one canonical URL.
     
  • AtlEscapeUrl: We use this function to convert all unsafe characters into escape sequences.
     
  • AtlGetDefaultUrlPort: We call this function to get the default port number associated with some particular internet protocol.
     
  • AtlHexValue: We call this function to get the numeric value of a hexadecimal digit.
     
  • AtlIsUnsafeUrlChar: We call this function to find out whether a character is safe to use in a URL or not.
     
  • AtlUnescapeUrl: We call this function to convert the escaped characters back to their previous original values.
     
  • SystemTimeToHttpDate: We call this function for the conversion of system time to string in a format suitable for use in HTTP headers.
     
  • ATLPath::AddBackslash: This function is an overloaded wrapper for PathAddBackslash.
     
  • ATLPath::AddExtension: This function is an overloaded wrapper for PathAddExtension.
     
  • ATLPath::Append: This function is an overloaded wrapper for PathAppend.
     
  • ATLPath::BuildRoot: This function is an overloaded wrapper for PathBuildRoot.
     
  • ATLPath::Canonicalize: This function is an overloaded wrapper for PathCanonicalize.
     
  • ATLPath::Combine: This function is an overloaded wrapper for PathCombine.
     
  • ATLPath::CommonPrefix: This function is an overloaded wrapper for PathCommonPrefix.
     
  • ATLPath::CompactPath: This function is an overloaded wrapper for PathCompactPath.
     
  • ATLPath::CompactPathEx: This function is an overloaded wrapper for PathCompactPathEx.
     
  • ATLPath::FileExists: This function is an overloaded wrapper for PathFileExists.
     
  • ATLPath::FindExtension: This function is an overloaded wrapper for PathFindExtension.
     
  • ATLPath::FindFileName: This function is an overloaded wrapper for PathFindFileName.
     
  • ATLPath::GetDriveNumber: This function is an overloaded wrapper for PathGetDriveNumber.
     
  • ATLPath::IsDirectory: This function is an overloaded wrapper for PathIsDirectory.
     
  • ATLPath::IsFileSpec: This function is an overloaded wrapper for PathIsFileSpec.
     
  • ATLPath::IsPrefix: This function is an overloaded wrapper for PathIsPrefix.
     
  • ATLPath::IsRelative: This function is an overloaded wrapper for PathIsRelative.
     
  • ATLPath::IsRoot: This function is an overloaded wrapper for PathIsRoot.
     
  • ATLPath::IsSameRoot: This function is an overloaded wrapper for PathIsSameRoot.
     
  • ATLPath::IsUNC: This function is an overloaded wrapper for PathIsUNC.
     
  • ATLPath::IsUNCServer: This function is an overloaded wrapper for PathIsUNCServer.
     
  • ATLPath::IsUNCServerShare: This function is an overloaded wrapper for PathIsUNCServerShare.
     
  • ATLPath::MakePretty: This function is an overloaded wrapper for PathMakePretty.
     
  • ATLPath::MatchSpec: This function is an overloaded wrapper for PathMatchSpec.
     
  • ATLPath::QuoteSpaces: This function is an overloaded wrapper for PathQuoteSpaces.
     
  • ATLPath::RelativePathTo: This function is an overloaded wrapper for PathRelativePathTo.
     
  • ATLPath::RemoveArgs: This function is an overloaded wrapper for PathRemoveArgs.
     
  • ATLPath::RemoveBackslash: This function is an overloaded wrapper for PathRemoveBackslash.
     
  • ATLPath::RemoveBlanks: This function is an overloaded wrapper for PathRemoveBlanks.
     
  • ATLPath::RemoveExtension: This function is an overloaded wrapper for PathRemoveExtension.
     
  • ATLPath::RemoveFileSpec: This function is an overloaded wrapper for PathRemoveFileSpec.
     
  • ATLPath::RenameExtension: This function is an overloaded wrapper for PathRenameExtension.
     
  • ATLPath::SkipRoot: This function is an overloaded wrapper for PathSkipRoot.
     
  • ATLPath::StripPath: This function is an overloaded wrapper for PathStripPath.
     
  • ATLPath::StripToRoot: This function is an overloaded wrapper for PathStripToRoot.
     
  • ATLPath::UnquoteSpaces: This function is an overloaded wrapper for PathUnquoteSpaces.
     

Frequently Asked Questions

What is ATL?

ATL stands for Active Template Library that supports vital COM features. Microsoft developed a set of template-based C++ classes to simplify the creation and programming of COM objects called the ATL classes.

What is COM?

COM is the Component Object Model, which Microsoft created as a distributed and platform-independent object-oriented system

What is CPathT?

This is an ATL class that represents the path.

What is CUrl?

We use this ATL class to represent the URL. It allows us to manipulate each element of the URL independently from the other elements. It is useful in both cases, whether we are building a string from scratch or parsing an existing URL string. 

What is CThreadPool?

It is an ATL class that provides a pool of worker threads, which help with the processing of work item queues.

Conclusion

In this blog, we have discussed the list for ATL Utilities. Hope it was helpful to you all. Check out our articles if you think this blog has helped you enhance your knowledge and want to learn more. Visit our website to read more such blogs. 

  1. Introduction To C++
  2. Data Types in C++
  3. Containers In C++ STL
  4. STL containers in C++

 

For placement preparations, you must look at the problemsinterview experiences, and interview bundles. Enroll in our courses and refer to the mock tests and problems available; look at the Problem Sheets interview experiences, and interview bundle for placement preparations. You can also book an interview session with us.  

Also, check out - Canonical Cover In DBMS.

Consider our paid courses, however, to give your career a competitive advantage!

Happy Coding!

Live masterclass