Skip to content

Commit

Permalink
chore: dom::create spelling
Browse files Browse the repository at this point in the history
vinniefalco committed Jun 20, 2023
1 parent 1a89402 commit 2e4b285
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion include/mrdox/Dom/DomArray.hpp
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ class MRDOX_DECL
{
if(index >= list_.size())
return nullptr;
return dom::makePointer<U>(list_[index], corpus_);
return dom::create<U>(list_[index], corpus_);
}
};

6 changes: 3 additions & 3 deletions include/mrdox/Support/Dom.hpp
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ class MRDOX_DECL
};

template<class U, class... Args>
auto makePointer(Args&&... args);
auto create(Args&&... args);

/** A pointer container for object or array.
*/
@@ -136,11 +136,11 @@ class Pointer
}

template<class U, class... Args>
friend auto makePointer(Args&&... args);
friend auto create(Args&&... args);
};

template<class U, class... Args>
auto makePointer(Args&&... args)
auto create(Args&&... args)
{
return Pointer<U>(new U(
std::forward<Args>(args)...));
8 changes: 4 additions & 4 deletions source/-adoc/Builder.cpp
Original file line number Diff line number Diff line change
@@ -164,7 +164,7 @@ Expected<std::string>
Builder::
renderSinglePageHeader()
{
auto obj = dom::makePointer<dom::Object>();
auto obj = dom::create<dom::Object>();
auto text = callTemplate("single-header.adoc.hbs", obj);
return text;
}
@@ -173,7 +173,7 @@ Expected<std::string>
Builder::
renderSinglePageFooter()
{
auto obj = dom::makePointer<dom::Object>();
auto obj = dom::create<dom::Object>();
auto text = callTemplate("single-footer.adoc.hbs", obj);
return text;
}
@@ -189,7 +189,7 @@ getSymbol(
[&]<class T>(T const& I) ->
dom::ObjectPtr
{
return dom::makePointer<
return dom::create<
DomSymbol<T>>(I, corpus_);
});
}
@@ -199,7 +199,7 @@ Builder::
createContext(
SymbolID const& id)
{
return dom::makePointer<DomContext>(
return dom::create<DomContext>(
DomContext::Hash({
{ "document", "test" },
{ "symbol", getSymbol(id) }
2 changes: 1 addition & 1 deletion source/Dom/DomBaseArray.cpp
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ get(
std::size_t index) const
{
if(index < list_.size())
return dom::makePointer<DomBase>(
return dom::create<DomBase>(
corpus_.get<RecordInfo>(
list_[index].Type.id),
list_[index],
2 changes: 1 addition & 1 deletion source/Dom/DomParam.cpp
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ get(std::string_view key) const
if(key == "name")
return dom::nonEmptyString(I_->Name);
if(key == "type")
return dom::makePointer<DomType>(I_->Type, corpus_);
return dom::create<DomType>(I_->Type, corpus_);
if(key == "default")
return dom::nonEmptyString(I_->Default);
return nullptr;
2 changes: 1 addition & 1 deletion source/Dom/DomParamArray.cpp
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ get(std::size_t index) const
{
if(index >= list_.size())
return nullptr;
return dom::makePointer<DomParam>(
return dom::create<DomParam>(
list_[index], corpus_);
}

4 changes: 2 additions & 2 deletions source/Dom/DomSource.cpp
Original file line number Diff line number Diff line change
@@ -32,11 +32,11 @@ get(std::string_view key) const
{
if(! I_.DefLoc)
return nullptr;
return dom::makePointer<DomLocation>(
return dom::create<DomLocation>(
*I_.DefLoc, corpus_);
}
if(key == "decl")
return dom::makePointer<DomArray<
return dom::create<DomArray<
Location, DomLocation>>(I_.Loc, corpus_);
return nullptr;
}
22 changes: 11 additions & 11 deletions source/Dom/DomSymbol.cpp
Original file line number Diff line number Diff line change
@@ -49,24 +49,24 @@ get(std::string_view key) const
if(key == "name")
return I_->Name;
if(key == "namespace")
return dom::makePointer<DomSymbolArray>(
return dom::create<DomSymbolArray>(
I_->Namespace, corpus_);
if(key == "doc")
{
if(I_->javadoc)
return dom::makePointer<DomJavadoc>(
return dom::create<DomJavadoc>(
*I_->javadoc, corpus_);
return nullptr;
}
if constexpr(std::derived_from<T, SourceInfo>)
{
if(key == "loc")
return dom::makePointer<DomSource>(*I_, corpus_);
return dom::create<DomSource>(*I_, corpus_);
}
if constexpr(T::isNamespace())
{
if(key == "members")
return dom::makePointer<DomSymbolArray>(
return dom::create<DomSymbolArray>(
I_->Members, corpus_);
if(key == "specializations")
return nullptr;
@@ -78,16 +78,16 @@ get(std::string_view key) const
if(key == "is-typedef")
return I_->IsTypeDef;
if(key == "bases")
return dom::makePointer<DomBaseArray>(
return dom::create<DomBaseArray>(
I_->Bases, corpus_);
if(key == "friends")
return dom::makePointer<DomSymbolArray>(
return dom::create<DomSymbolArray>(
I_->Friends, corpus_);
if(key == "members")
return dom::makePointer<DomSymbolArray>(
return dom::create<DomSymbolArray>(
I_->Members, corpus_);
if(key == "specializations")
return dom::makePointer<DomSymbolArray>(
return dom::create<DomSymbolArray>(
I_->Specializations, corpus_);
if(key == "template")
{
@@ -99,13 +99,13 @@ get(std::string_view key) const
if constexpr(T::isFunction())
{
if(key == "params")
return dom::makePointer<DomParamArray>(
return dom::create<DomParamArray>(
I_->Params, corpus_);
if(key == "return")
return dom::makePointer<DomType>(
return dom::create<DomType>(
I_->ReturnType, corpus_);
if(key == "specs")
return dom::makePointer<DomFnSpecs>(
return dom::create<DomFnSpecs>(
*I_, corpus_);
if(key == "template")
{
2 changes: 1 addition & 1 deletion source/Dom/DomSymbolArray.cpp
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ get(std::size_t index) const
[&]<class T>(T const& I) ->
dom::ObjectPtr
{
return dom::makePointer<
return dom::create<
DomSymbol<T>>(I, corpus_);
});
}
2 changes: 1 addition & 1 deletion source/Dom/DomType.cpp
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ get(std::string_view key) const
[&]<class T>(T const& I) ->
dom::ObjectPtr
{
return dom::makePointer<
return dom::create<
DomSymbol<T>>(I, corpus_);
});
}

0 comments on commit 2e4b285

Please sign in to comment.