Comments (9)
- методы класса, не требующие обращения к данным класса, следует сделать статическими
from oop.
- mistake - это ошибка, совершаемая человеком, а не компьютером
from oop.
https://localhost:80
URL: https://localhost/
Protocol: HTTPS
Domain: localhost
Port: 80
Document path: /
http://localhost:443
URL: http://localhost/
Protocol: HTTP
Domain: localhost
Port: 443
Document path: /
- Порт не должен выводиться, только если он соответствует дефолтному порту протокола
from oop.
void CHttpUrl::ParseUrl(std::string const & url)
{
std::string urlStr(url);
auto protocolStr = ParseProtocol(urlStr);
m_protocol = StrToProtocol(protocolStr);
urlStr = urlStr.substr(protocolStr.size() + 3);
m_domain = ParseDomain(urlStr);
urlStr = urlStr.substr(m_domain.size());
if (urlStr[0] == ':')
{
m_port = std::stoi(ParsePort(urlStr));
urlStr = urlStr.substr(std::to_string(m_port).size() + 1);
}
else
{
m_port = (m_protocol == Protocol::HTTP) ? 80 : 443;
}
m_document = ParseDocumentPath(urlStr);
}
- Реализовать без отрезания головы. Чтобы не передавать постоянно начальный индекс, можно воспользоваться boost::string_ref
from oop.
- ProtocolToStr сделайте свободной функцией ,принимающей протокол
from oop.
- Конкретизируйте имена тестов, чтобы они читались как спецификация
from oop.
- Не покрыты тестами ветки кода. Внесенная ошибка не обнаружена
from oop.
https://ya.ru:80
Invalid URL port.
http://ya.ru:80
Invalid URL port.
- ошибка. Воспроизвести в тестах
from oop.
k=0.8
from oop.
Related Issues (8)
- Замечания по программе Replace HOT 10
- Замечания по Лабораторной работе №1 "invert" HOT 8
- Замечания по Vector HOT 6
- Замечания по HtmlDecode HOT 10
- Замечания по генератору простых чисел HOT 4
- Замечания по Car HOT 9
- Замечания по FindMaxEx HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oop.